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 to its ESCOMP/master branch 20220606 commit #66

Closed
wants to merge 90 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
90 commits
Select commit Hold shift + click to select a range
afd91d4
add new flux computation for UFS model and add new coupling mode for …
uturuncoglu Nov 24, 2021
3758f9f
fix area field for new flux algorithm
uturuncoglu Nov 29, 2021
0f635e1
send fluxes to atmospheric model
uturuncoglu Dec 7, 2021
53ebc24
initial implementation for sending fluxes to UFS ATM
uturuncoglu Dec 19, 2021
7784990
merge with origin/master
uturuncoglu Dec 30, 2021
bba5b4e
update with master
uturuncoglu Jan 6, 2022
cdfbb35
update ccpp aoflux code
uturuncoglu Jan 8, 2022
a80db60
fix upward longwave sign issue
uturuncoglu Jan 11, 2022
2d57af5
mods to solve sign issue in the fluxes
uturuncoglu Jan 12, 2022
7471055
update to use both flux scheme (cesm, ccpp) under UFS
uturuncoglu Jan 13, 2022
5fec3a0
revert mods in prep atm phase
uturuncoglu Jan 13, 2022
22af6e5
initial attempt to have host model for CCPP
uturuncoglu Jan 28, 2022
84be138
Minor updates to get CCPP handshake right
climbfuji Jan 31, 2022
e22ebb6
Merge pull request #1 from climbfuji/exchange_grid_dom_20220130
uturuncoglu Jan 31, 2022
cdb2025
more work for CCPP host model
uturuncoglu Feb 1, 2022
6237d13
Updates and bug fixes to complete ccpp_prebuild.py call
climbfuji Feb 3, 2022
0c9b470
Include Sl_soilw field exchange for CAM CARMA aerosol configurations …
fvitt Feb 4, 2022
4297d0b
minor fixes
uturuncoglu Feb 4, 2022
699c177
add support for sfc_diff
uturuncoglu Feb 5, 2022
e1dead1
fix namespace collision
uturuncoglu Feb 6, 2022
792be4c
update CCPP host model
uturuncoglu Feb 8, 2022
2a3cb9e
fix latent and sensible heat fluxes and clean code
uturuncoglu Feb 9, 2022
f127fa6
add new coupling mode for side by side flux comparison
uturuncoglu Feb 9, 2022
e813a97
fix CCPP host model for latent and sensible heat fluxes
uturuncoglu Feb 22, 2022
4f93182
fix aoflux calculation on agrid and add missing error checks
uturuncoglu Feb 24, 2022
8526e31
do not use biliear and patch under UFS exchnage grid
uturuncoglu Feb 24, 2022
bf9e4b3
add support to get ccpp suite from config file
uturuncoglu Feb 25, 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
f6c8f0b
correct COMP_NAME (was CIME_COMP)
jedwards4b Apr 4, 2022
20af1d7
Merge pull request #280 from jedwards4b/buildexe_fix
jedwards4b Apr 4, 2022
f12b1d9
fix for data configurations
uturuncoglu Apr 6, 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
6654167
add option to write meshes and update code that retrieve area informa…
uturuncoglu Apr 17, 2022
383f11c
update ccpp host based on recent changes in ccpp framework
uturuncoglu Apr 17, 2022
d56d53b
fix for providing cell area to CCPP host model
uturuncoglu Apr 19, 2022
c99de05
make ccpp physics options configurable
uturuncoglu Apr 19, 2022
ef360ea
Refactor nems field exchange; set default masks for mapping in med_in…
DeniseWorthen Apr 22, 2022
3018d88
use mesh file instead of grid name (#285)
jedwards4b Apr 25, 2022
150677a
dont repeat user_nl entries (#289)
jedwards4b Apr 26, 2022
a7886b9
changes to fix scam and add wave/ice coupling (#290)
mvertens Apr 26, 2022
5acea36
fixes for aquaplanet
Apr 27, 2022
b6549d6
Merge pull request #292 from mvertens/feature/fix_cmeps0_13_57
jedwards4b Apr 27, 2022
6a54cb6
fixes to get can single column SCT test to pass (#293)
mvertens Apr 28, 2022
3dbaa6c
need to initialize these variables
jedwards4b Apr 29, 2022
4223e15
Merge pull request #294 from jedwards4b/initialize_scol_nij
jedwards4b Apr 29, 2022
c57d725
fix name of driver log
jedwards4b Apr 29, 2022
260ab82
Merge pull request #295 from jedwards4b/fix_MCC_test
jedwards4b Apr 29, 2022
a4c7438
add wave/cice coupling fields (#296)
mvertens May 3, 2022
bed9c56
update CMEPS and fix to work with latest version of CCPP physics
uturuncoglu May 4, 2022
f2385cc
fix char length issue for gnu compiler
uturuncoglu May 4, 2022
44b4e8f
update esmf build in workflow
jedwards4b May 5, 2022
d71c522
fix build
jedwards4b May 5, 2022
89681d4
fix error in esmf build
jedwards4b May 5, 2022
32e544a
fix pio version
jedwards4b May 5, 2022
95e148b
Merge pull request #298 from jedwards4b/workflow_update_esmf
jedwards4b May 5, 2022
36d880a
Merge remote-tracking branch 'origin/master' into feature/xgrid_dev_host
uturuncoglu May 5, 2022
139047e
make qmin constant
uturuncoglu May 5, 2022
1bef7aa
declare constants as parameters
uturuncoglu May 6, 2022
b0eee2c
fix for UFS OpnReqTests debug test
May 6, 2022
4d91092
Merge branch 'feature/xgrid_dev_host' of https://github.com/uturuncog…
May 6, 2022
d307cd5
fix threading issue in CCPP driver
uturuncoglu May 9, 2022
3fe2c87
update naming convention and use _med suffix in CCPP host model
May 10, 2022
dfdb479
add restart capability to CCPP host model
May 15, 2022
a8bb766
more work to bring restart capability to CCPP host model
May 16, 2022
355557a
fix to write data on exchange grid
uturuncoglu May 18, 2022
31f9316
more work for ccpp restart capability, agrid and ogrid are passing now
May 20, 2022
c90b9f1
fix ccpp restart for xgrid and add support for sfc_diag
May 21, 2022
c7e92a6
update to fix ORT issues
May 25, 2022
54e8ae5
add missing call to read restart file
May 25, 2022
14b8216
fix for gnu compiler
uturuncoglu May 25, 2022
b0e5418
change standard name of new option and couple of minor fix for debug …
uturuncoglu May 26, 2022
e1e91b5
fix conditional to check nproc
uturuncoglu May 26, 2022
2e3f061
fix for initial conditions, default is not to read
uturuncoglu May 26, 2022
81a2807
add new field to adjust new version of physics code
uturuncoglu May 27, 2022
7ec1916
Merge pull request #282 from uturuncoglu/feature/xgrid_dev_host
uturuncoglu Jun 7, 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
31 changes: 20 additions & 11 deletions .github/workflows/extbuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,10 @@ jobs:
CXX: mpicxx
CPPFLAGS: "-I/usr/include -I/usr/local/include"
# Versions of all dependencies can be updated here
ESMF_VERSION: ESMF_8_2_0_beta_snapshot_14
PNETCDF_VERSION: pnetcdf-1.12.2
ESMF_VERSION: v8.3.0b13
PNETCDF_VERSION: pnetcdf-1.12.3
NETCDF_FORTRAN_VERSION: v4.5.2
# PIO version is awkward
PIO_VERSION_DIR: pio2_5_3
PIO_VERSION: pio-2.5.3
PIO_VERSION: pio2_5_7
steps:
- uses: actions/checkout@v2
# Build the ESMF library, if the cache contains a previous build
Expand All @@ -38,12 +36,19 @@ jobs:
run: |
sudo apt-get update
sudo apt-get install gfortran wget openmpi-bin netcdf-bin libopenmpi-dev libnetcdf-dev
- id: checkout-ESMF
uses: actions/checkout@v3
with:
repository: esmf-org/esmf
path: esmf-src
ref: ${{ env.ESMF_VERSION }}
- id: build-ESMF
if: steps.cache-esmf.outputs.cache-hit != 'true'
run: |
wget https://github.com/esmf-org/esmf/archive/${{ env.ESMF_VERSION }}.tar.gz
tar -xzvf ${{ env.ESMF_VERSION }}.tar.gz
pushd esmf-${{ env.ESMF_VERSION }}
#wget https://github.com/esmf-org/esmf/archive/${{ env.ESMF_VERSION }}.tar.gz
#tar -xzvf ${{ env.ESMF_VERSION }}.tar.gz
#pushd esmf-${{ env.ESMF_VERSION }}
pushd esmf-src
export ESMF_DIR=`pwd`
export ESMF_COMM=openmpi
export ESMF_YAMLCPP="internal"
Expand Down Expand Up @@ -95,14 +100,18 @@ jobs:
${{ runner.os }}-${{ env.NETCDF_FORTRAN_VERSION }}-netcdf-fortran
${{ runner.os }}-${{ env.PNETCDF_VERSION }}-pnetcdf

- id: checkout-PIO
uses: actions/checkout@v3
with:
repository: NCAR/ParallelIO
path: parallelio-src
ref: ${{ env.PIO_VERSION }}
- name: Build PIO
if: steps.cache-PIO.outputs.cache-hit != 'true'
run: |
wget https://github.com/NCAR/ParallelIO/releases/download/${{ env.PIO_VERSION_DIR }}/${{ env.PIO_VERSION }}.tar.gz
tar -xzvf ${{ env.PIO_VERSION }}.tar.gz
mkdir build-pio
pushd build-pio
cmake -Wno-dev -DNetCDF_C_LIBRARY=/usr/lib/x86_64-linux-gnu/libnetcdf.so -DNetCDF_C_INCLUDE_DIR=/usr/include -DCMAKE_PREFIX_PATH=/usr -DCMAKE_INSTALL_PREFIX=$HOME/pio -DPIO_HDF5_LOGGING=On -DPIO_USE_MALLOC=On -DPIO_ENABLE_TESTS=Off -DPIO_ENABLE_LOGGING=On -DPIO_ENABLE_EXAMPLES=Off -DPIO_ENABLE_TIMING=Off -DNetCDF_Fortran_PATH=$HOME/netcdf-fortran -DPnetCDF_PATH=$HOME/pnetcdf ../${{ env.PIO_VERSION }}
cmake -Wno-dev -DNetCDF_C_LIBRARY=/usr/lib/x86_64-linux-gnu/libnetcdf.so -DNetCDF_C_INCLUDE_DIR=/usr/include -DCMAKE_PREFIX_PATH=/usr -DCMAKE_INSTALL_PREFIX=$HOME/pio -DPIO_HDF5_LOGGING=On -DPIO_USE_MALLOC=On -DPIO_ENABLE_TESTS=Off -DPIO_ENABLE_LOGGING=On -DPIO_ENABLE_EXAMPLES=Off -DPIO_ENABLE_TIMING=Off -DNetCDF_Fortran_PATH=$HOME/netcdf-fortran -DPnetCDF_PATH=$HOME/pnetcdf ../parallelio-src
make VERBOSE=1
make install
popd
Expand Down
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
104 changes: 79 additions & 25 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 All @@ -1195,6 +1203,8 @@ subroutine esm_set_single_column_attributes(compname, gcomp, rc)
use netcdf, only : nf90_inq_dimid, nf90_inquire_dimension, nf90_inq_varid, nf90_get_var
use NUOPC , only : NUOPC_CompAttributeGet, NUOPC_CompAttributeSet, NUOPC_CompAttributeAdd
use ESMF , only : ESMF_GridComp, ESMF_GridCompGet, ESMF_VM, ESMF_VMGet, ESMF_SUCCESS
use ESMF , only : ESMF_Mesh, ESMF_MeshCreate, ESMF_FILEFORMAT_ESMFMESH, ESMF_MeshGet, ESMF_MESHLOC_ELEMENT
use ESMF , only : ESMF_Field, ESMF_FieldCreate, ESMF_FieldGet, ESMF_FieldRegridGetArea, ESMF_TYPEKIND_r8

! input/output variables
character(len=*) , intent(in) :: compname
Expand All @@ -1204,14 +1214,24 @@ subroutine esm_set_single_column_attributes(compname, gcomp, rc)
! local variables
type(ESMF_VM) :: vm
character(len=CL) :: single_column_lnd_domainfile
character(len=CL) :: single_column_global_meshfile
real(r8) :: scol_lon
real(r8) :: scol_lat
real(r8) :: scol_area
integer :: scol_lndmask
real(r8) :: scol_lndfrac
integer :: scol_ocnmask
real(r8) :: scol_ocnfrac
integer :: i,j,ni,nj
integer :: scol_mesh_n
type(ESMF_Mesh) :: mesh
type(ESMF_Field) :: lfield
integer :: lsize
integer :: spatialdim
real(r8), pointer :: ownedElemCoords(:)
real(r8), pointer :: latMesh(:)
real(r8), pointer :: lonMesh(:)
real(r8), pointer :: dataptr(:)
integer :: i,j,ni,nj,n
integer :: ncid
integer :: dimid
integer :: varid_xc
Expand All @@ -1235,7 +1255,6 @@ subroutine esm_set_single_column_attributes(compname, gcomp, rc)
character(len=*), parameter :: subname= ' (esm_get_single_column_attributes) '
!-------------------------------------------------------------------------------


rc = ESMF_SUCCESS

! obtain the single column lon and lat
Expand All @@ -1247,6 +1266,8 @@ subroutine esm_set_single_column_attributes(compname, gcomp, rc)
read(cvalue,*) scol_lat
call NUOPC_CompAttributeGet(gcomp, name='single_column_lnd_domainfile', value=single_column_lnd_domainfile, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
call NUOPC_CompAttributeGet(gcomp, name='mesh_atm', value=single_column_global_meshfile, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
call NUOPC_CompAttributeAdd(gcomp, attrList=(/'scol_spval'/), rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return

Expand Down Expand Up @@ -1341,6 +1362,7 @@ subroutine esm_set_single_column_attributes(compname, gcomp, rc)
do j = 1,nj
lats(j) = glob_grid(1,j)
end do

! find nearest neighbor indices of scol_lon and scol_lat in single_column_lnd_domain file
! convert lons array and scol_lon to 0,360 and find index of value closest to 0
! and obtain single-column longitude/latitude indices to retrieve
Expand Down Expand Up @@ -1380,26 +1402,53 @@ subroutine esm_set_single_column_attributes(compname, gcomp, rc)
//' ocean and land mask cannot both be zero')
end if

status = nf90_close(ncid)
if (status /= nf90_noerr) call shr_sys_abort (trim(subname) //': closing '//&
trim(single_column_lnd_domainfile))

! Now read in mesh file to get exact values of scol_lon and scol_lat that will be used
! by the models - assume that this occurs only on 1 processor
mesh = ESMF_MeshCreate(filename=trim(single_column_global_meshfile), fileformat=ESMF_FILEFORMAT_ESMFMESH, rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
call ESMF_MeshGet(mesh, spatialDim=spatialDim, numOwnedElements=lsize, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
allocate(ownedElemCoords(spatialDim*lsize))
allocate(lonMesh(lsize), latMesh(lsize))
call ESMF_MeshGet(mesh, ownedElemCoords=ownedElemCoords)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
do n = 1,lsize
lonMesh(n) = ownedElemCoords(2*n-1)
latMesh(n) = ownedElemCoords(2*n)
if (abs(lonMesh(n) - scol_lon) < 1.e-4 .and. abs(latMesh(n) - scol_lat) < 1.e-4) then
scol_mesh_n = n
scol_mesh_n = n
exit
end if
end do
scol_lon = lonMesh(scol_mesh_n)
scol_lat = latMesh(scol_mesh_n)

! Obtain mesh info areas
lfield = ESMF_FieldCreate(mesh, ESMF_TYPEKIND_r8, name='area', meshloc=ESMF_MESHLOC_ELEMENT, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
call ESMF_FieldRegridGetArea(lfield, rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
call ESMF_FieldGet(lfield, farrayPtr=dataptr, rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
scol_area = dataptr(scol_mesh_n)

! Set single column attribute values for all components
write(cvalue,*) scol_lon
call NUOPC_CompAttributeSet(gcomp, name='scol_lon', value=trim(cvalue), rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return

write(cvalue,*) scol_lat
call NUOPC_CompAttributeSet(gcomp, name='scol_lat', value=trim(cvalue), rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return

write(cvalue,*) ni
call NUOPC_CompAttributeSet(gcomp, name='scol_ni', value=trim(cvalue), rc=rc)
write(cvalue,*) scol_area
call NUOPC_CompAttributeSet(gcomp, name='scol_area', value=trim(cvalue), rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return

write(cvalue,*) nj
call NUOPC_CompAttributeSet(gcomp, name='scol_nj', value=trim(cvalue), rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return

status = nf90_close(ncid)
if (status /= nf90_noerr) call shr_sys_abort (trim(subname) //': closing '//&
trim(single_column_lnd_domainfile))

! Write out diagnostic info
write(logunit,'(a,2(f13.5,2x))')trim(subname)//' nearest neighbor scol_lon and scol_lat in '&
//trim(single_column_lnd_domainfile)//' are ',scol_lon,scol_lat
if (trim(compname) == 'LND') then
Expand All @@ -1411,6 +1460,12 @@ subroutine esm_set_single_column_attributes(compname, gcomp, rc)
else
write(logunit,'(a)')trim(subname)//' atm point has unit mask and unit fraction '
end if
write(cvalue,*) ni
call NUOPC_CompAttributeSet(gcomp, name='scol_ni', value=trim(cvalue), rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
write(cvalue,*) nj
call NUOPC_CompAttributeSet(gcomp, name='scol_nj', value=trim(cvalue), rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return

else

Expand All @@ -1423,12 +1478,11 @@ subroutine esm_set_single_column_attributes(compname, gcomp, rc)
scol_ocnfrac = 1._r8
scol_area = 1.e30

write(cvalue,*) 1
call NUOPC_CompAttributeSet(gcomp, name='scol_ni', value=trim(cvalue), rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
write(cvalue,*) 1
call NUOPC_CompAttributeSet(gcomp, name='scol_nj', value=trim(cvalue), rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
write(cvalue,*) 1

write(logunit,'(a)')' single point mode is active'
write(logunit,'(a,f13.5,a,f13.5,a)')' scol_lon is ',scol_lon,' and scol_lat is '
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