Skip to content

Commit 699e16f

Browse files
authored
Merge pull request #123 from GEOS-ESM/develop
2 parents 995e8e3 + 03978e3 commit 699e16f

36 files changed

Lines changed: 4955 additions & 10 deletions

.circleci/config.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
version: 2.1
22

33
# Anchors in case we need to override the defaults from the orb
4+
45
#baselibs_version: &baselibs_version v8.5.0
56
#bcs_version: &bcs_version v12.0.0
67

78
orbs:
89
ci: geos-esm/circleci-tools@5
910

11+
1012
workflows:
1113
build-test:
1214
jobs:

.github/workflows/enforce-labels.yml

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
types: [opened, labeled, unlabeled, edited, synchronize]
66

77
jobs:
8-
require-label:
8+
require-coupled-label:
99
runs-on: ubuntu-latest
1010
steps:
1111
- uses: mheap/github-action-required-labels@v5
@@ -14,9 +14,35 @@ jobs:
1414
with:
1515
mode: minimum
1616
count: 1
17-
labels: "0 diff,0 diff trivial,Non 0-diff,0 diff structural,0-diff trivial,Not 0-diff,0-diff,automatic,0-diff uncoupled,github_actions"
17+
labels: "0 diff coupled,non 0-diff coupled"
1818
add_comment: true
19-
message: "This PR is being prevented from merging because you have not added one of our required labels: {{ provided }}. Please add one so that the PR can be merged."
19+
message: "This PR is being prevented from merging because you have not added one of our required labels to say if they are 0-diff or non-0-diff for coupled runs: {{ provided }}. Please add so that the PR can be merged."
20+
21+
require-dataatm-label:
22+
runs-on: ubuntu-latest
23+
steps:
24+
- uses: mheap/github-action-required-labels@v5
25+
env:
26+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
27+
with:
28+
mode: minimum
29+
count: 1
30+
labels: "0 diff dataatm,non 0-diff dataatm"
31+
add_comment: true
32+
message: "This PR is being prevented from merging because you have not added one of our required labels to say if they are 0-diff or non-0-diff for dataatm runs: {{ provided }}. Please add so that the PR can be merged."
33+
34+
require-dataocean-label:
35+
runs-on: ubuntu-latest
36+
steps:
37+
- uses: mheap/github-action-required-labels@v5
38+
env:
39+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
40+
with:
41+
mode: minimum
42+
count: 1
43+
labels: "0 diff dataocean,non 0-diff dataocean"
44+
add_comment: true
45+
message: "This PR is being prevented from merging because you have not added one of our required labels to say if they are 0-diff or non-0-diff for dataocean runs: {{ provided }}. Please add so that the PR can be merged."
2046

2147
blocking-label:
2248
runs-on: ubuntu-latest

GEOS_OceanGridComp.F90

Lines changed: 33 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ module GEOS_OceanGridCompMod
4343
integer :: OCN
4444
integer :: OCNd
4545
logical :: DUAL_OCEAN
46+
logical :: DO_DATA_ATM4OCN
4647

4748
contains
4849

@@ -101,6 +102,8 @@ subroutine SetServices ( GC, RC )
101102
call MAPL_GetResource (MAPL, DO_DATASEA, Label="USE_DATASEA:" , DEFAULT=1, _RC)
102103
call MAPL_GetResource (MAPL, OrphanDepth, Label="OGCM_TOP_LAYER:" , DEFAULT=10.0, _RC)
103104

105+
call MAPL_GetResource (MAPL, DO_DATA_ATM4OCN, Label="USE_DATA_ATM4OCN:", DEFAULT=.FALSE., _RC)
106+
104107
if(DO_DATASEA/=0) then
105108
OCEAN_NAME="DATASEA"
106109
OCN = MAPL_AddChild(GC, NAME=OCEAN_NAME, SS=DataSeaSetServices, _RC)
@@ -188,11 +191,11 @@ subroutine SetServices ( GC, RC )
188191

189192
if(DO_DATASEA==0) then
190193
call MAPL_TerminateImport ( GC, SHORT_NAME= &
191-
[character(len=9) :: 'TAUX ','TAUY ', &
192-
'PENUVR','PENPAR','PENUVF','PENPAF', 'DRNIR', 'DFNIR', &
193-
'DISCHARGE', 'LWFLX', 'SHFLX', 'QFLUX', 'RAIN', 'SNOW', &
194-
'SFLX','SWHEAT'], & ! do not terminate import of PEN_OCN since it is not used in the `plug'
195-
CHILD=OCN, _RC)
194+
[character(len=9) :: 'TAUX ','TAUY ', &
195+
'PENUVR','PENPAR','PENUVF','PENPAF', 'DRNIR', 'DFNIR', &
196+
'DISCHARGE','CALVING','LWFLX', 'SHFLX', 'QFLUX', 'RAIN', 'SNOW', &
197+
'SFLX','SWHEAT'], & ! do not terminate import of PEN_OCN since it is not used in the `plug'
198+
CHILD=OCN, _RC)
196199
end if
197200

198201
! Set the Initialize, Run, Finalize entry points
@@ -421,6 +424,7 @@ subroutine Run ( GC, IMPORT, EXPORT, CLOCK, RC )
421424
real, pointer :: DFNIRi(:,:)
422425
real, pointer :: HEATi(:,:,:)
423426
real, pointer :: DISCHARGEi(:,:)
427+
real, pointer :: CALVINGi(:,:)
424428
real, pointer :: LWFLXi(:,:)
425429
real, pointer :: SHFLXi(:,:)
426430
real, pointer :: QFLUXi(:,:)
@@ -446,6 +450,7 @@ subroutine Run ( GC, IMPORT, EXPORT, CLOCK, RC )
446450
real, pointer :: HEATe (:,:,:)
447451
real, pointer :: FROCEANe (:,:)
448452
real, pointer :: DISCHARGEe(:,:)
453+
real, pointer :: CALVINGe(:,:)
449454
real, pointer :: LWFLXe(:,:)
450455
real, pointer :: SWFLXe(:,:)
451456
real, pointer :: SHFLXe(:,:)
@@ -467,6 +472,7 @@ subroutine Run ( GC, IMPORT, EXPORT, CLOCK, RC )
467472
real, pointer :: DFNIR(:,:)
468473
real, pointer :: HEAT(:,:,:)
469474
real, pointer :: DISCHARGE(:,:)
475+
real, pointer :: CALVING(:,:)
470476
real, pointer :: LWFLX(:,:)
471477
real, pointer :: SHFLX(:,:)
472478
real, pointer :: QFLUX(:,:)
@@ -620,6 +626,10 @@ subroutine Run ( GC, IMPORT, EXPORT, CLOCK, RC )
620626
call MAPL_GetPointer(IMPORT, FRESH, 'FRESH' , _RC)
621627
call MAPL_GetPointer(IMPORT, FSALT, 'FSALT' , _RC)
622628

629+
if(DO_DATA_ATM4OCN) then
630+
call MAPL_GetPointer(IMPORT, CALVINGi, 'CALVING', _RC)
631+
endif
632+
623633
! Get pointers from ImExState
624634
!----------------------------
625635
if(DO_DATASEA==0) then
@@ -633,6 +643,7 @@ subroutine Run ( GC, IMPORT, EXPORT, CLOCK, RC )
633643
call MAPL_GetPointer(GIM(OCN), DFNIR, 'DFNIR' , _RC)
634644
call MAPL_GetPointer(GIM(OCN), HEAT, 'SWHEAT', _RC)
635645
call MAPL_GetPointer(GIM(OCN), DISCHARGE, 'DISCHARGE', _RC)
646+
call MAPL_GetPointer(GIM(OCN), CALVING, 'CALVING', _RC)
636647
call MAPL_GetPointer(GIM(OCN), LWFLX, 'LWFLX' , _RC)
637648
call MAPL_GetPointer(GIM(OCN), SHFLX, 'SHFLX' , _RC)
638649
call MAPL_GetPointer(GIM(OCN), QFLUX, 'QFLUX' , _RC)
@@ -681,6 +692,7 @@ subroutine Run ( GC, IMPORT, EXPORT, CLOCK, RC )
681692
call MAPL_GetPointer(EXPORT, TAUYe, 'TAUY' , _RC)
682693
call MAPL_GetPointer(EXPORT, HEATe, 'SWHEAT' , _RC)
683694
call MAPL_GetPointer(EXPORT, DISCHARGEe, 'DISCHARGE', _RC)
695+
call MAPL_GetPointer(EXPORT, CALVINGe, 'CALVING', _RC)
684696
call MAPL_GetPointer(EXPORT, LWFLXe, 'LWFLX' , _RC)
685697
call MAPL_GetPointer(EXPORT, SWFLXe, 'SWFLX' , _RC)
686698
call MAPL_GetPointer(EXPORT, SHFLXe, 'SHFLX' , _RC)
@@ -690,6 +702,7 @@ subroutine Run ( GC, IMPORT, EXPORT, CLOCK, RC )
690702
call MAPL_GetPointer(EXPORT, SFLXe, 'SFLX' , _RC)
691703
call MAPL_GetPointer(EXPORT, PEN_OCNe, 'PEN_OCN', _RC)
692704

705+
693706
if(associated(FROCEANe)) FROCEANe = FROCEAN
694707

695708
! Allocate space for temporary arrays
@@ -720,7 +733,20 @@ subroutine Run ( GC, IMPORT, EXPORT, CLOCK, RC )
720733
PENPAF = PENPAFi * WGHT
721734
DRNIR = DRNIRi * WGHT
722735
DFNIR = DFNIRi * WGHT
723-
DISCHARGE = DISCHARGEi * WGHT
736+
if(DO_DATA_ATM4OCN) then
737+
DISCHARGE = DISCHARGEi
738+
CALVING = CALVINGi
739+
! may not be needed
740+
where(DISCHARGE < 0.0)
741+
DISCHARGE = 0.0
742+
endwhere
743+
where(CALVING < 0.0)
744+
CALVING = 0.0
745+
endwhere
746+
else
747+
DISCHARGE = DISCHARGEi * WGHT
748+
CALVING = 0.0
749+
endif
724750
LWFLX = LWFLXi * WGHT
725751
QFLUX = QFLUXi * WGHT
726752
SHFLX = (SHFLXi-FHOCN) * WGHT
@@ -753,6 +779,7 @@ subroutine Run ( GC, IMPORT, EXPORT, CLOCK, RC )
753779
if (associated(TAUXe)) TAUXe = TAUX
754780
if (associated(TAUYe)) TAUYe = TAUY
755781
if (associated(DISCHARGEe)) DISCHARGEe = DISCHARGE
782+
if (associated(CALVINGe)) CALVINGe = CALVING
756783
if (associated(LWFLXe)) LWFLXe = LWFLX
757784
if (associated(SWFLXe)) SWFLXe = PENUVR+PENPAR+PENUVF+PENPAF+DRNIR+DFNIR
758785
if (associated(SHFLXe)) SHFLXe = SHFLX

GEOS_Ocean_StateSpecs.rc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ DRNIR | W m-2 | xy | N |
1818
DFNIR | W m-2 | xy | N | | | net_surface_downwelling_nir_diffuse_flux
1919
SWHEAT | W m-2 | xyz | C | | | solar_heating_rate
2020
DISCHARGE | kg m-2 s-1 | xy | N | | | river_discharge_at_ocean_points
21+
CALVING | kg m-2 s-1 | xy | N | DO_DATA_ATM4OCN | | ice_calving_at_ocean_points_from_datm
2122
TR | 1 | xyz | C | trim(OCEAN_NAME) == 'MOM' | MAPL_BundleItem | tracer_mixing_ratios
2223
TRFLUX | X | xy | N | trim(OCEAN_NAME) == 'MOM' | MAPL_BundleItem | surface_fluxes_of_tracers
2324
LWFLX | W m-2 | xy | N | | | surface_net_downward_longwave_flux
@@ -53,6 +54,7 @@ TAUY | N m-2 | xy | N |
5354
SWHEAT | W m-2 | xyz | C | | solar_heating_rate
5455
RFLUX | W m-2 | xy | N | | downward_radiative_heat_flux_at_ocean_bottom
5556
DISCHARGE | kg m-2 s-1 | xy | N | | river_discharge_at_ocean_points
57+
CALVING | kg m-2 s-1 | xy | N | | ice_calving_at_ocean_points
5658
FROCEAN | 1 | xy | N | | fraction_of_gridbox_covered_by_ocean
5759
LWFLX | W m-2 | xy | N | | surface_net_downward_longwave_flux
5860
SWFLX | W m-2 | xy | N | | surface_net_downward_shortwave_flux
Lines changed: 156 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,156 @@
1+
#ifndef _CPP_EEOPTIONS_H_
2+
#define _CPP_EEOPTIONS_H_
3+
4+
CBOP
5+
C !ROUTINE: CPP_EEOPTIONS.h
6+
C !INTERFACE:
7+
C include "CPP_EEOPTIONS.h"
8+
C
9+
C !DESCRIPTION:
10+
C *==========================================================*
11+
C | CPP\_EEOPTIONS.h |
12+
C *==========================================================*
13+
C | C preprocessor "execution environment" supporting |
14+
C | flags. Use this file to set flags controlling the |
15+
C | execution environment in which a model runs - as opposed |
16+
C | to the dynamical problem the model solves. |
17+
C | Note: Many options are implemented with both compile time|
18+
C | and run-time switches. This allows options to be |
19+
C | removed altogether, made optional at run-time or |
20+
C | to be permanently enabled. This convention helps |
21+
C | with the data-dependence analysis performed by the |
22+
C | adjoint model compiler. This data dependency |
23+
C | analysis can be upset by runtime switches that it |
24+
C | is unable to recoginise as being fixed for the |
25+
C | duration of an integration. |
26+
C | A reasonable way to use these flags is to |
27+
C | set all options as selectable at runtime but then |
28+
C | once an experimental configuration has been |
29+
C | identified, rebuild the code with the appropriate |
30+
C | options set at compile time. |
31+
C *==========================================================*
32+
CEOP
33+
34+
C In general the following convention applies:
35+
C ALLOW - indicates an feature will be included but it may
36+
C CAN have a run-time flag to allow it to be switched
37+
C on and off.
38+
C If ALLOW or CAN directives are "undef'd" this generally
39+
C means that the feature will not be available i.e. it
40+
C will not be included in the compiled code and so no
41+
C run-time option to use the feature will be available.
42+
C
43+
C ALWAYS - indicates the choice will be fixed at compile time
44+
C so no run-time option will be present
45+
46+
C=== Macro related options ===
47+
C-- Control storage of floating point operands
48+
C On many systems it improves performance only to use
49+
C 8-byte precision for time stepped variables.
50+
C Constant in time terms ( geometric factors etc.. )
51+
C can use 4-byte precision, reducing memory utilisation and
52+
C boosting performance because of a smaller working set size.
53+
C However, on vector CRAY systems this degrades performance.
54+
C Enable to switch REAL4_IS_SLOW from genmake2 (with LET_RS_BE_REAL4):
55+
#ifdef LET_RS_BE_REAL4
56+
#undef REAL4_IS_SLOW
57+
#else /* LET_RS_BE_REAL4 */
58+
#define REAL4_IS_SLOW
59+
#endif /* LET_RS_BE_REAL4 */
60+
61+
C-- Control use of "double" precision constants.
62+
C Use D0 where it means REAL*8 but not where it means REAL*16
63+
#define D0 d0
64+
65+
C=== IO related options ===
66+
C-- Flag used to indicate whether Fortran formatted write
67+
C and read are threadsafe. On SGI the routines can be thread
68+
C safe, on Sun it is not possible - if you are unsure then
69+
C undef this option.
70+
#undef FMTFTN_IO_THREAD_SAFE
71+
72+
C-- Flag used to indicate whether Binary write to Local file (i.e.,
73+
C a different file for each tile) and read are thread-safe.
74+
#undef LOCBIN_IO_THREAD_SAFE
75+
76+
C-- Flag to turn off the writing of error message to ioUnit zero
77+
#undef DISABLE_WRITE_TO_UNIT_ZERO
78+
79+
C-- Alternative formulation of BYTESWAP, faster than
80+
C compiler flag -byteswapio on the Altix.
81+
#undef FAST_BYTESWAP
82+
83+
C-- Flag to turn on old default of opening scratch files with the
84+
C STATUS='SCRATCH' option. This method, while perfectly FORTRAN-standard,
85+
C caused filename conflicts on some multi-node/multi-processor platforms
86+
C in the past and has been replace by something (hopefully) more robust.
87+
#undef USE_FORTRAN_SCRATCH_FILES
88+
89+
C-- Flag defined for eeboot_minimal.F, eeset_parms.F and open_copy_data_file.F
90+
C to write STDOUT, STDERR and scratch files from process 0 only.
91+
C WARNING: to use only when absolutely confident that the setup is working
92+
C since any message (error/warning/print) from any proc <> 0 will be lost.
93+
#undef SINGLE_DISK_IO
94+
95+
C=== MPI, EXCH and GLOBAL_SUM related options ===
96+
C-- Flag turns off MPI_SEND ready_to_receive polling in the
97+
C gather_* subroutines to speed up integrations.
98+
#undef DISABLE_MPI_READY_TO_RECEIVE
99+
100+
C-- Control MPI based parallel processing
101+
CXXX We no longer select the use of MPI via this file (CPP_EEOPTIONS.h)
102+
CXXX To use MPI, use an appropriate genmake2 options file or use
103+
CXXX genmake2 -mpi .
104+
CXXX #undef ALLOW_USE_MPI
105+
106+
C-- Control use of communication that might overlap computation.
107+
C Under MPI selects/deselects "non-blocking" sends and receives.
108+
#undef ALLOW_ASYNC_COMMUNICATION
109+
#undef ALWAYS_USE_ASYNC_COMMUNICATION
110+
C-- Control use of communication that is atomic to computation.
111+
C Under MPI selects/deselects "blocking" sends and receives.
112+
#define ALLOW_SYNC_COMMUNICATION
113+
#undef ALWAYS_USE_SYNC_COMMUNICATION
114+
115+
C-- Control XY periodicity in processor to grid mappings
116+
C Note: Model code does not need to know whether a domain is
117+
C periodic because it has overlap regions for every box.
118+
C Model assume that these values have been
119+
C filled in some way.
120+
#undef ALWAYS_PREVENT_X_PERIODICITY
121+
#undef ALWAYS_PREVENT_Y_PERIODICITY
122+
#define CAN_PREVENT_X_PERIODICITY
123+
#define CAN_PREVENT_Y_PERIODICITY
124+
125+
C-- disconnect tiles (no exchange between tiles, just fill-in edges
126+
C assuming locally periodic subdomain)
127+
#undef DISCONNECTED_TILES
128+
129+
C-- Always cumulate tile local-sum in the same order by applying MPI allreduce
130+
C to array of tiles ; can get slower with large number of tiles (big set-up)
131+
#define GLOBAL_SUM_ORDER_TILES
132+
133+
C-- Alternative way of doing global sum without MPI allreduce call
134+
C but instead, explicit MPI send & recv calls. Expected to be slower.
135+
#undef GLOBAL_SUM_SEND_RECV
136+
137+
C-- Alternative way of doing global sum on a single CPU
138+
C to eliminate tiling-dependent roundoff errors. Note: This is slow.
139+
#undef CG2D_SINGLECPU_SUM
140+
141+
C=== Other options (to add/remove pieces of code) ===
142+
C-- Flag to turn on checking for errors from all threads and procs
143+
C (calling S/R STOP_IF_ERROR) before stopping.
144+
#define USE_ERROR_STOP
145+
146+
C-- Control use of communication with other component:
147+
C allow to import and export from/to Coupler interface.
148+
#undef COMPONENT_MODULE
149+
150+
C-- Activate some pieces of code for coupling to GEOS AGCM
151+
#define HACK_FOR_GMAO_CPL
152+
153+
C=== And define Macros ===
154+
#include "CPP_EEMACROS.h"
155+
156+
#endif /* _CPP_EEOPTIONS_H_ */

0 commit comments

Comments
 (0)