Skip to content

Commit

Permalink
Merge branch 'release/8.8.0' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
theurich committed Jan 8, 2025
2 parents 61ef91b + 48d6018 commit 88d3eb2
Show file tree
Hide file tree
Showing 16 changed files with 1,239 additions and 40 deletions.
15 changes: 15 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,21 @@ AtmOcnMirrorFieldsProto/field_ocn_import_pmsl.nc
AtmOcnMirrorFieldsProto/field_ocn_import_rsns.nc
AtmOcnMirrorFieldsProto/ocn.mod
AtmOcnMirrorFieldsProto/ocn.o
AtmOcnMirrorFieldsWithNamespaceProto/PET0.ESMF_LogFile
AtmOcnMirrorFieldsWithNamespaceProto/PET1.ESMF_LogFile
AtmOcnMirrorFieldsWithNamespaceProto/PET2.ESMF_LogFile
AtmOcnMirrorFieldsWithNamespaceProto/PET3.ESMF_LogFile
AtmOcnMirrorFieldsWithNamespaceProto/atm.mod
AtmOcnMirrorFieldsWithNamespaceProto/atm.o
AtmOcnMirrorFieldsWithNamespaceProto/esm.mod
AtmOcnMirrorFieldsWithNamespaceProto/esm.o
AtmOcnMirrorFieldsWithNamespaceProto/esmApp
AtmOcnMirrorFieldsWithNamespaceProto/esmApp.o
AtmOcnMirrorFieldsWithNamespaceProto/esmApp.stdout
AtmOcnMirrorFieldsWithNamespaceProto/field_atm_import_namespace:ocn_sea_surface_temperature.nc
AtmOcnMirrorFieldsWithNamespaceProto/field_ocn_export_sst.nc
AtmOcnMirrorFieldsWithNamespaceProto/ocn.mod
AtmOcnMirrorFieldsWithNamespaceProto/ocn.o
AtmOcnPetListProto/PET0.ESMF_LogFile
AtmOcnPetListProto/PET1.ESMF_LogFile
AtmOcnPetListProto/PET2.ESMF_LogFile
Expand Down
21 changes: 11 additions & 10 deletions AtmOcnMirrorFieldsProto/README
Original file line number Diff line number Diff line change
Expand Up @@ -12,28 +12,29 @@ Description:

The ESM driver uses explicitly constructed petLists when adding the two
model components.

The ESM driver component uses the default run sequence to implement coupling
between ATM and OCN components.
between ATM and OCN components.

The connector components are explicitly added by the driver.

The OCN component use a simple two-phase initialization, consisting of
advertise and realize.

The ATM component uses a three-phase initialization, consisting of
advertise/request-mirror, modify mirror-advertised fields, realize.


The ATM component uses a three-phase initialization, consisting of
advertise/request-mirror with FieldTransferPolicy="transferAll",
modify mirror-advertised fields, realize.


Build:
- Set environment variable ESMFMKFILE to point to the esmf.mk of your ESMF
installation.
- make

Execution:
- Optionally set environment variable ESMF_RUNTIME_COMPLIANCECHECK to ON.
- mpirun -np X ./esmApp (where X is the total number of PETs, typically 4)

Output:
- PET*.Log files containing compliance checker output if turned on.
- The prototype outputs time stepping information to stdout.
Expand Down
10 changes: 8 additions & 2 deletions AtmOcnMirrorFieldsProto/atm.F90
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,13 @@ subroutine ModifyAdvertised(model, rc)
!TODO: settings, and go between components on different threading levels.
!TODO: This is an edge case, but long term it should be supported.

#if 0
!TODO: The problem in StateReconcile() comes from the UNIQUE_GEOM_INFO_TREAT_on
!TODO: handling. Once that part is reworked inside StateReconcile() the mixed
!TODO: sharing case should work again!

!TODO: For now share Grid and Field for both fields.

#if 1
! set SharePolicyGeomObject = "share"
call NUOPC_SetAttribute(field, name="SharePolicyGeomObject", &
value="share", rc=rc)
Expand All @@ -254,7 +260,7 @@ subroutine ModifyAdvertised(model, rc)
file=__FILE__)) &
return ! bail out
#endif
#if 0
#if 1
! set SharePolicyField = "share"
call NUOPC_SetAttribute(field, name="SharePolicyField", &
value="share", rc=rc)
Expand Down
1 change: 1 addition & 0 deletions AtmOcnMirrorFieldsProto/ocn.F90
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ subroutine Advertise(model, rc)
StandardName="air_pressure_at_sea_level", name="pmsl", &
#ifdef TEST_SHARING
SharePolicyGeomObject="share", &
SharePolicyField="share", &
#endif
rc=rc)
if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, &
Expand Down
76 changes: 76 additions & 0 deletions AtmOcnMirrorFieldsWithNamespaceProto/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# GNU Makefile template for user ESMF application

################################################################################
################################################################################
## This Makefile must be able to find the "esmf.mk" Makefile fragment in the ##
## 'include' line below. Following the ESMF User's Guide, a complete ESMF ##
## installation should ensure that a single environment variable "ESMFMKFILE" ##
## is made available on the system. This variable should point to the ##
## "esmf.mk" file. ##
## ##
## This example Makefile uses the "ESMFMKFILE" environment variable. ##
## ##
## If you notice that this Makefile cannot find variable ESMFMKFILE then ##
## please contact the person responsible for the ESMF installation on your ##
## system. ##
## As a work-around you can simply hardcode the path to "esmf.mk" in the ##
## include line below. However, doing so will render this Makefile a lot less ##
## flexible and non-portable. ##
################################################################################

ifneq ($(origin ESMFMKFILE), environment)
$(error Environment variable ESMFMKFILE was not set.)
endif

include $(ESMFMKFILE)

# strip quotes around the ESMF_INTERNAL_MPIRUN value
ESMF_INTERNAL_MPIRUN := $(shell echo $(ESMF_INTERNAL_MPIRUN))

################################################################################
################################################################################

.SUFFIXES: .f90 .F90 .c .C

%.o : %.f90
$(ESMF_F90COMPILER) -c $(ESMF_F90COMPILEOPTS) $(ESMF_F90COMPILEPATHS) $(ESMF_F90COMPILEFREENOCPP) $<

%.o : %.F90
$(ESMF_F90COMPILER) -c $(ESMF_F90COMPILEOPTS) $(ESMF_F90COMPILEPATHS) $(ESMF_F90COMPILEFREECPP) $(ESMF_F90COMPILECPPFLAGS) $<

%.o : %.c
$(ESMF_CXXCOMPILER) -c $(ESMF_CXXCOMPILEOPTS) $(ESMF_CXXCOMPILEPATHSLOCAL) $(ESMF_CXXCOMPILEPATHS) $(ESMF_CXXCOMPILECPPFLAGS) $<

%.o : %.C
$(ESMF_CXXCOMPILER) -c $(ESMF_CXXCOMPILEOPTS) $(ESMF_CXXCOMPILEPATHSLOCAL) $(ESMF_CXXCOMPILEPATHS) $(ESMF_CXXCOMPILECPPFLAGS) $<


# -----------------------------------------------------------------------------
esmApp: esmApp.o esm.o atm.o ocn.o
$(ESMF_F90LINKER) $(ESMF_F90LINKOPTS) $(ESMF_F90LINKPATHS) $(ESMF_F90LINKRPATHS) -o $@ $^ $(ESMF_F90ESMFLINKLIBS)

# module dependencies:
esmApp.o: esm.o
esm.o: atm.o ocn.o

# -----------------------------------------------------------------------------
# -----------------------------------------------------------------------------
.PHONY: dust clean distclean info edit
dust:
rm -f PET*.ESMF_LogFile *.nc *.stdout
clean:
rm -f esmApp *.o *.mod
distclean: dust clean

info:
@echo ==================================================================
@echo ESMFMKFILE=$(ESMFMKFILE)
@echo ==================================================================
@cat $(ESMFMKFILE)
@echo ==================================================================

edit:
nedit esmApp.F90 esm.F90 atm.F90 ocn.F90 &

run:
$(ESMF_INTERNAL_MPIRUN) -np 4 ./esmApp
48 changes: 48 additions & 0 deletions AtmOcnMirrorFieldsWithNamespaceProto/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
README for ATM-OCN with field mirroring NUOPC prototype
-------------------------------------------------------

A simple two model system, where one Model component requests field mirroring
with Namesapces on one of its States.

Description:

A two-way coupled system with a single driver (ESM) and two model components
(ATM, OCN).

The ESM driver uses explicitly constructed petLists when adding the two
model components.

The ESM driver component uses the default run sequence to implement coupling
between ATM and OCN components.

The connector components are explicitly added by the driver.

The OCN component use a simple two-phase initialization, consisting of
advertise and realize.

The ATM component uses a three-phase initialization, consisting of
advertise/request-mirror with FieldTransferPolicy="transferAllWithNamespace",
modify mirror-advertised fields, realize.


Build:
- Set environment variable ESMFMKFILE to point to the esmf.mk of your ESMF
installation.
- make

Execution:
- Optionally set environment variable ESMF_RUNTIME_COMPLIANCECHECK to ON.
- mpirun -np X ./esmApp (where X is the total number of PETs, typically 4)

Output:
- PET*.Log files containing compliance checker output if turned on.
- The prototype outputs time stepping information to stdout.

Code structure:
- Makefile - Makefile that is based on the standard esmf.mk mechanism.
- atm.F90 - The ATM component, specializing generic NUOPC_Model.
- ocn.F90 - The OCN component, specializing generic NUOPC_Model.
- esm.F90 - The Earth System Model (ESM) component, specializing generic
NUOPC_Driver. Define partial petLists for ATM and OCN.
- esmApp.F90 - ESM application.

Loading

0 comments on commit 88d3eb2

Please sign in to comment.