Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update CMEPS; refactor esmFieldsExchange_nems and default_masks #65

Merged
merged 30 commits into from
May 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
233a89b
add fix for file writing when dststatus_print=true
DeniseWorthen Sep 7, 2021
c26a1b6
Merge remote-tracking branch 'escomp/master' into feature/updcmeps
DeniseWorthen Sep 21, 2021
aae1fe9
Merge remote-tracking branch 'escomp/master' into feature/updcmeps
DeniseWorthen Oct 13, 2021
a0011cb
Merge remote-tracking branch 'MV/feature/cism_bugfixes' into feature/…
DeniseWorthen Oct 15, 2021
88c9808
Merge branch 'NOAA-EMC:emc/develop' into feature/updcmeps
DeniseWorthen Nov 25, 2021
391ebab
Merge remote-tracking branch 'escomp/master' into feature/updcmeps
DeniseWorthen Nov 26, 2021
0c9b470
Include Sl_soilw field exchange for CAM CARMA aerosol configurations …
fvitt Feb 4, 2022
4f93182
fix aoflux calculation on agrid and add missing error checks
uturuncoglu Feb 24, 2022
c719817
initialize count
Feb 28, 2022
a75898f
Merge pull request #271 from uturuncoglu/hotfix/aoflux_agrid
uturuncoglu Mar 2, 2022
82ee2f3
Merge pull request #273 from peverwhee/nuopc_tests
jedwards4b Mar 9, 2022
abce725
clean version of add_container_support (#276)
jedwards4b Mar 30, 2022
a332fc8
Addition of enthalpy fluxes in CESM (#278)
mvertens Apr 1, 2022
052c404
Merge branch 'NOAA-EMC:emc/develop' into feature/updcmeps
DeniseWorthen Apr 4, 2022
f6c8f0b
correct COMP_NAME (was CIME_COMP)
jedwards4b Apr 4, 2022
20af1d7
Merge pull request #280 from jedwards4b/buildexe_fix
jedwards4b Apr 4, 2022
27dd3d0
move pio parameters to nuopc.runconfig input file
jedwards4b Feb 7, 2022
a21f70b
X case compiles
jedwards4b Feb 7, 2022
a3e3f87
ongoing work
jedwards4b Feb 18, 2022
aab10fc
more read config
jedwards4b Mar 14, 2022
8f4737d
get logging to work
jedwards4b Mar 17, 2022
25d0e73
some cleanup
jedwards4b Mar 17, 2022
1193194
must work with ufs
jedwards4b Mar 17, 2022
aff27cb
more logging fixes, correct syntax in shr_pio_mod
jedwards4b Mar 17, 2022
d23ad4b
clean up code
jedwards4b Mar 23, 2022
d8e82e8
fix bugs in pio interface
jedwards4b Apr 1, 2022
167b0eb
handle inst number in fortran
jedwards4b Apr 13, 2022
fb16730
Merge pull request #275 from jedwards4b/modelio_to_runconfig
jedwards4b Apr 15, 2022
ef360ea
Refactor nems field exchange; set default masks for mapping in med_in…
DeniseWorthen Apr 22, 2022
70d3f16
Merge remote-tracking branch 'escomp/master' into feature/updcmeps
DeniseWorthen Apr 23, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cesm/driver/ensemble_driver.F90
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ subroutine SetModelServices(ensemble_driver, rc)
call ReadAttributes(driver, config, "DRIVER_attributes::", rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return

call ReadAttributes(driver, config, "DRV_modelio"//trim(inst_suffix)//"::", rc=rc)
call ReadAttributes(driver, config, "DRV_modelio::", rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return

! Set the driver log to the driver task 0
Expand Down
26 changes: 17 additions & 9 deletions cesm/driver/esm.F90
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@ module ESM
!-----------------------------------------------------------------------------

use shr_kind_mod , only : r8=>shr_kind_r8, cl=>shr_kind_cl, cs=>shr_kind_cs
use shr_log_mod , only : shrlogunit=> shr_log_unit
use shr_sys_mod , only : shr_sys_abort
use shr_mpi_mod , only : shr_mpi_bcast
use shr_mem_mod , only : shr_mem_init
use shr_file_mod , only : shr_file_setLogunit
use esm_utils_mod, only : logunit, mastertask, dbug_flag, chkerr
use perf_mod , only : t_initf
use perf_mod , only : t_initf, t_setLogUnit

implicit none
private
Expand Down Expand Up @@ -220,8 +219,7 @@ subroutine SetModelServices(driver, rc)
!-------------------------------------------
! Timer initialization (has to be after pelayouts are determined)
!-------------------------------------------

call t_initf('drv_in', LogPrint=.true., mpicom=global_comm, mastertask=mastertask, MaxThreads=maxthreads)
call t_initf('drv_in', LogPrint=.true., LogUnit=logunit, mpicom=global_comm, mastertask=mastertask, MaxThreads=maxthreads)

call ESMF_LogWrite(trim(subname)//": done", ESMF_LOGMSG_INFO)

Expand Down Expand Up @@ -670,8 +668,11 @@ subroutine AddAttributes(gcomp, driver, config, compid, compname, inst_suffix, n
if (chkerr(rc,__LINE__,u_FILE_u)) return
call ReadAttributes(gcomp, config, "ALLCOMP_attributes::", rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
call ReadAttributes(gcomp, config, trim(compname)//"_modelio"//trim(inst_suffix)//"::", rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
call ReadAttributes(gcomp, config, trim(compname)//"_modelio::", rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) then
print *,__FILE__,__LINE__,"ERROR reading ",trim(compname)," modelio from runconfig"
return
endif
call ReadAttributes(gcomp, config, "CLOCK_attributes::", rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return

Expand Down Expand Up @@ -807,7 +808,7 @@ subroutine esm_init_pelayout(driver, maxthreads, rc)
use mpi , only : MPI_COMM_NULL, mpi_comm_size
#endif
use mct_mod , only : mct_world_init
use shr_pio_mod , only : shr_pio_init2
use shr_pio_mod , only : shr_pio_init, shr_pio_component_init

#ifdef MED_PRESENT
use med_internalstate_mod , only : med_id
Expand Down Expand Up @@ -931,6 +932,11 @@ subroutine esm_init_pelayout(driver, maxthreads, rc)
inst_suffix = ""
endif

! Initialize PIO
! This reads in the pio parameters that are independent of component
call shr_pio_init(driver, rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return

allocate(comms(componentCount+1), comps(componentCount+1))
comps(1) = 1
comms = MPI_COMM_NULL
Expand Down Expand Up @@ -1174,12 +1180,14 @@ subroutine esm_init_pelayout(driver, maxthreads, rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return

enddo
! Read in component dependent PIO parameters and initialize
! IO systems
call shr_pio_component_init(driver, size(comps), rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return

! Initialize MCT (this is needed for data models and cice prescribed capability)
call mct_world_init(componentCount+1, GLOBAL_COMM, comms, comps)

! Initialize PIO
call shr_pio_init2(comps(2:), compLabels, comp_iamin, comms(2:), comp_comm_iam)

deallocate(petlist, comms, comps, comp_iamin, comp_comm_iam)

Expand Down
12 changes: 0 additions & 12 deletions cesm/driver/esmApp.F90
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ program esmApp
use mpi
use NUOPC, only : NUOPC_FieldDictionarySetup
use ensemble_driver, only : SetServices
use shr_pio_mod, only : shr_pio_init1
use shr_sys_mod, only : shr_sys_abort

implicit none
Expand Down Expand Up @@ -44,17 +43,6 @@ program esmApp
#endif
COMP_COMM = MPI_COMM_WORLD

!-----------------------------------------------------------------------------
! Initialize PIO
!-----------------------------------------------------------------------------

! For planned future use of async io using pio2. The IO tasks are seperated from the compute tasks here
! and COMP_COMM will be MPI_COMM_NULL on the IO tasks which then call shr_pio_init2 and do not return until
! the model completes. All other tasks call ESMF_Initialize. 8 is the maximum number of component models
! supported

call shr_pio_init1(8, "drv_in", COMP_COMM)

!-----------------------------------------------------------------------------
! Initialize ESMF
!-----------------------------------------------------------------------------
Expand Down
File renamed without changes.
17 changes: 14 additions & 3 deletions cesm/nuopc_cap_share/nuopc_shr_methods.F90
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ end subroutine get_component_instance
!===============================================================================

subroutine set_component_logging(gcomp, mastertask, logunit, shrlogunit, rc)

use shr_pio_mod, only : shr_pio_log_comp_settings
! input/output variables
type(ESMF_GridComp) :: gcomp
logical, intent(in) :: mastertask
Expand All @@ -143,6 +143,8 @@ subroutine set_component_logging(gcomp, mastertask, logunit, shrlogunit, rc)
! local variables
character(len=CL) :: diro
character(len=CL) :: logfile
character(len=CL) :: inst_suffix
integer :: inst_index ! not used here
!-----------------------------------------------------------------------

rc = ESMF_SUCCESS
Expand All @@ -154,14 +156,23 @@ subroutine set_component_logging(gcomp, mastertask, logunit, shrlogunit, rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
call NUOPC_CompAttributeGet(gcomp, name="logfile", value=logfile, rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
call get_component_instance(gcomp, inst_suffix, inst_index, rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
! Multiinstance logfile name needs a correction
if(logfile(4:4) == '_') then
logfile = logfile(1:3)//trim(inst_suffix)//logfile(9:)
endif

open(newunit=logunit,file=trim(diro)//"/"//trim(logfile))
! Write the PIO settings to the beggining of each component log
call shr_pio_log_comp_settings(gcomp, logunit)

else
logUnit = 6
endif

! TODO: shr_file mod is deprecated and should be removed.
call shr_file_setLogUnit (logunit)

end subroutine set_component_logging

!===============================================================================
Expand Down
1 change: 1 addition & 0 deletions cesm/nuopc_cap_share/seq_drydep_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -893,6 +893,7 @@ subroutine seq_drydep_readnl(NLFilename, drydep_nflds)
!-----------------------------------------------------------------------------

rc = ESMF_SUCCESS
drydep_nflds = 0

!--- Open and read namelist ---
if ( len_trim(NLFilename) == 0 )then
Expand Down
6 changes: 3 additions & 3 deletions cesm/nuopc_cap_share/shr_ndep_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ subroutine shr_ndep_readnl(NLFilename, ndep_nflds)
character(len=32) :: ndep_list(maxspc) = '' ! List of ndep species
integer :: localpet
integer :: mpicom
character(*),parameter :: F00 = "('(shr_ndep_read) ',8a)"
character(*),parameter :: FI1 = "('(shr_ndep_init) ',a,I2)"
character(*),parameter :: subName = '(shr_ndep_read) '

character(*),parameter :: subName = '(shr_ndep_readnl) '
character(*),parameter :: F00 = "('(shr_ndep_readnl) ',8a)"
! ------------------------------------------------------------------

namelist /ndep_inparm/ ndep_list
Expand Down
Loading