diff --git a/.gitmodules b/.gitmodules index 2fe70e7..f5c365c 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,9 +1,9 @@ [submodule "CMEPS/CMEPS"] path = CMEPS/CMEPS - url = https://github.com/ESCOMP/CMEPS + url = https://github.com/access-nri/cmeps [submodule "CDEPS/CDEPS"] path = CDEPS/CDEPS - url = https://github.com/ESCOMP/CDEPS + url = https://github.com/access-nri/cdeps [submodule "share/CESM_share"] path = share/CESM_share - url = https://github.com/ESCOMP/CESM_share.git + url = https://github.com/access-nri/cesm_share diff --git a/CDEPS/CDEPS b/CDEPS/CDEPS index debc545..269a12b 160000 --- a/CDEPS/CDEPS +++ b/CDEPS/CDEPS @@ -1 +1 @@ -Subproject commit debc5453e75195fac8bc418318322a1a63402d16 +Subproject commit 269a12bb60487d7ead28d98ba4e39da984390e8f diff --git a/CDEPS/CMakeLists.txt b/CDEPS/CMakeLists.txt index 8d4f8ad..eaa51be 100644 --- a/CDEPS/CMakeLists.txt +++ b/CDEPS/CMakeLists.txt @@ -6,6 +6,7 @@ ## Common library add_fortran_library(ACCESS3_cdeps_common mod/common STATIC) add_library(Access3::cdeps_common ALIAS ACCESS3_cdeps_common) +target_include_directories(ACCESS3_cdeps_common PRIVATE $) target_link_libraries(ACCESS3_cdeps_common PUBLIC ESMF::ESMF PRIVATE Access3::share Access3::cmeps Access3::nuopc_cap_share FoX::FoX @@ -24,25 +25,27 @@ target_sources(ACCESS3_cdeps_common PRIVATE ## DATM add_fortran_library(ACCESS3_cdeps_datm mod/datm STATIC) add_library(Access3::cdeps_datm ALIAS ACCESS3_cdeps_datm) +target_include_directories(ACCESS3_cdeps_datm PRIVATE $) target_link_libraries(ACCESS3_cdeps_datm PUBLIC ESMF::ESMF PRIVATE Access3::cdeps_common Access3::share ) target_sources(ACCESS3_cdeps_datm PRIVATE + CDEPS/datm/atm_comp_nuopc.F90 CDEPS/datm/datm_datamode_clmncep_mod.F90 CDEPS/datm/datm_datamode_core2_mod.F90 CDEPS/datm/datm_datamode_cplhist_mod.F90 CDEPS/datm/datm_datamode_era5_mod.F90 CDEPS/datm/datm_datamode_gefs_mod.F90 CDEPS/datm/datm_datamode_jra_mod.F90 + CDEPS/datm/datm_datamode_jra55do_mod.F90 CDEPS/datm/datm_datamode_simple_mod.F90 - extra_sources/datm_datamode_jra55do_mod.F90 ) -add_patched_source(ACCESS3_cdeps_datm CDEPS/datm/atm_comp_nuopc.F90) ## DOCN add_fortran_library(ACCESS3_cdeps_docn mod/docn STATIC) add_library(Access3::cdeps_docn ALIAS ACCESS3_cdeps_docn) +target_include_directories(ACCESS3_cdeps_docn PRIVATE $) target_link_libraries(ACCESS3_cdeps_docn PUBLIC ESMF::ESMF PRIVATE Access3::cdeps_common Access3::share @@ -57,11 +60,13 @@ target_sources(ACCESS3_cdeps_docn PRIVATE CDEPS/docn/docn_datamode_som_mod.F90 CDEPS/docn/docn_import_data_mod.F90 CDEPS/docn/ocn_comp_nuopc.F90 + CDEPS/docn/docn_datamode_multilev_cplhist_mod.F90 ) ## DICE add_fortran_library(ACCESS3_cdeps_dice mod/dice STATIC) add_library(Access3::cdeps_dice ALIAS ACCESS3_cdeps_dice) +target_include_directories(ACCESS3_cdeps_dice PRIVATE $) target_link_libraries(ACCESS3_cdeps_dice PUBLIC ESMF::ESMF PRIVATE Access3::cdeps_common Access3::share @@ -76,6 +81,7 @@ target_sources(ACCESS3_cdeps_dice PRIVATE ## DWAV add_fortran_library(ACCESS3_cdeps_dwav mod/dwav STATIC) add_library(Access3::cdeps_dwav ALIAS ACCESS3_cdeps_dwav) +target_include_directories(ACCESS3_cdeps_dwav PRIVATE $) target_link_libraries(ACCESS3_cdeps_dwav PUBLIC ESMF::ESMF PRIVATE Access3::cdeps_common Access3::share @@ -87,6 +93,7 @@ target_sources(ACCESS3_cdeps_dwav PRIVATE ## DROF add_fortran_library(ACCESS3_cdeps_drof mod/drof STATIC) add_library(Access3::cdeps_drof ALIAS ACCESS3_cdeps_drof) +target_include_directories(ACCESS3_cdeps_drof PRIVATE $) target_link_libraries(ACCESS3_cdeps_drof PUBLIC ESMF::ESMF PRIVATE Access3::cdeps_common Access3::share diff --git a/CDEPS/extra_sources/datm_datamode_jra55do_mod.F90 b/CDEPS/extra_sources/datm_datamode_jra55do_mod.F90 deleted file mode 100644 index 53d6e49..0000000 --- a/CDEPS/extra_sources/datm_datamode_jra55do_mod.F90 +++ /dev/null @@ -1,287 +0,0 @@ -! Copyright ACCESS-NRI and contributors. See the top-level COPYRIGHT file for details. -! SPDX-License-Identifier: Apache-2.0 - -module datm_datamode_jra55do_mod - - use ESMF , only : ESMF_State, ESMF_StateGet, ESMF_SUCCESS, ESMF_LogWrite, ESMF_LOGMSG_INFO - use ESMF , only : ESMF_MeshGet - use ESMF , only : ESMF_StateItem_Flag, ESMF_STATEITEM_NOTFOUND, operator(/=) - use NUOPC , only : NUOPC_Advertise - use shr_kind_mod , only : r8=>shr_kind_r8, i8=>shr_kind_i8, cl=>shr_kind_cl, cs=>shr_kind_cs - use shr_sys_mod , only : shr_sys_abort - use shr_cal_mod , only : shr_cal_date2julian - use shr_const_mod , only : shr_const_tkfrz, shr_const_pi, shr_const_rdair - use dshr_strdata_mod , only : shr_strdata_get_stream_pointer, shr_strdata_type - use dshr_methods_mod , only : dshr_state_getfldptr, dshr_fldbun_getfldptr, dshr_fldbun_regrid, chkerr - use dshr_strdata_mod , only : shr_strdata_type - use dshr_fldlist_mod , only : fldlist_type, dshr_fldlist_add - - implicit none - private ! except - - public :: datm_datamode_jra55do_advertise - public :: datm_datamode_jra55do_init_pointers - public :: datm_datamode_jra55do_advance - - - ! export state pointers - real(r8), pointer :: Sa_z(:) => null() - real(r8), pointer :: Sa_tbot(:) => null() - real(r8), pointer :: Sa_ptem(:) => null() - real(r8), pointer :: Sa_shum(:) => null() - real(r8), pointer :: Sa_dens(:) => null() - real(r8), pointer :: Sa_pbot(:) => null() - real(r8), pointer :: Sa_pslv(:) => null() - real(r8), pointer :: Faxa_rainc(:) => null() - real(r8), pointer :: Faxa_rainl(:) => null() - real(r8), pointer :: Faxa_snowc(:) => null() - real(r8), pointer :: Faxa_snowl(:) => null() - real(r8), pointer :: Faxa_swndr(:) => null() - real(r8), pointer :: Faxa_swndf(:) => null() - real(r8), pointer :: Faxa_swvdr(:) => null() - real(r8), pointer :: Faxa_swvdf(:) => null() - real(r8), pointer :: Faxa_swnet(:) => null() - real(r8), pointer :: Faxa_ndep(:,:) => null() - - ! stream data - real(r8), pointer :: strm_prrn(:) => null() ! Rainfall flux - real(r8), pointer :: strm_prsn(:) => null() ! Snowfall flux - real(r8), pointer :: strm_swdn(:) => null() - - ! othe module arrays - real(R8), pointer :: yc(:) ! array of model latitudes - - ! constants - real(R8) , parameter :: tKFrz = SHR_CONST_TKFRZ - real(R8) , parameter :: rdair = SHR_CONST_RDAIR ! dry air gas constant ~ J/K/kg - real(R8) , parameter :: degtorad = SHR_CONST_PI/180.0_R8 - real(R8) , parameter :: phs_c0 = 0.298_R8 - real(R8) , parameter :: dLWarc = -5.000_R8 - - character(*), parameter :: nullstr = 'null' - character(*), parameter :: rpfile = 'rpointer.atm' - character(*), parameter :: u_FILE_u = & - __FILE__ - -!=============================================================================== -contains -!=============================================================================== - - subroutine datm_datamode_jra55do_advertise(exportState, fldsexport, flds_scalar_name, & - flds_co2, flds_wiso, flds_presaero, flds_presndep, rc) - - ! input/output variables - type(esmf_State) , intent(inout) :: exportState - type(fldlist_type) , pointer :: fldsexport - character(len=*) , intent(in) :: flds_scalar_name - logical , intent(in) :: flds_co2 - logical , intent(in) :: flds_wiso - logical , intent(in) :: flds_presaero - logical , intent(in) :: flds_presndep - integer , intent(out) :: rc - - ! local variables - type(fldlist_type), pointer :: fldList - !------------------------------------------------------------------------------- - - rc = ESMF_SUCCESS - - call dshr_fldList_add(fldsExport, trim(flds_scalar_name)) - call dshr_fldList_add(fldsExport, 'Sa_z' ) - call dshr_fldList_add(fldsExport, 'Sa_u' ) - call dshr_fldList_add(fldsExport, 'Sa_v' ) - call dshr_fldList_add(fldsExport, 'Sa_ptem' ) - call dshr_fldList_add(fldsExport, 'Sa_dens' ) - call dshr_fldList_add(fldsExport, 'Sa_pslv' ) - call dshr_fldList_add(fldsExport, 'Sa_tbot' ) - call dshr_fldList_add(fldsExport, 'Sa_pbot' ) - call dshr_fldList_add(fldsExport, 'Sa_shum' ) - call dshr_fldList_add(fldsExport, 'Faxa_rainc' ) - call dshr_fldList_add(fldsExport, 'Faxa_rainl' ) - call dshr_fldList_add(fldsExport, 'Faxa_snowc' ) - call dshr_fldList_add(fldsExport, 'Faxa_snowl' ) - call dshr_fldList_add(fldsExport, 'Faxa_swndr' ) - call dshr_fldList_add(fldsExport, 'Faxa_swvdr' ) - call dshr_fldList_add(fldsExport, 'Faxa_swndf' ) - call dshr_fldList_add(fldsExport, 'Faxa_swvdf' ) - call dshr_fldList_add(fldsExport, 'Faxa_swnet' ) - call dshr_fldList_add(fldsExport, 'Faxa_lwdn' ) - call dshr_fldList_add(fldsExport, 'Faxa_swdn' ) - - if (flds_co2) then - call dshr_fldList_add(fldsExport, 'Sa_co2prog') - call dshr_fldList_add(fldsExport, 'Sa_co2diag') - end if - if (flds_presaero) then - call dshr_fldList_add(fldsExport, 'Faxa_bcph' , ungridded_lbound=1, ungridded_ubound=3) - call dshr_fldList_add(fldsExport, 'Faxa_ocph' , ungridded_lbound=1, ungridded_ubound=3) - call dshr_fldList_add(fldsExport, 'Faxa_dstwet' , ungridded_lbound=1, ungridded_ubound=4) - call dshr_fldList_add(fldsExport, 'Faxa_dstdry' , ungridded_lbound=1, ungridded_ubound=4) - end if - if (flds_presndep) then - call dshr_fldList_add(fldsExport, 'Faxa_ndep', ungridded_lbound=1, ungridded_ubound=2) - end if - if (flds_wiso) then - call dshr_fldList_add(fldsExport, 'Faxa_rainc_wiso', ungridded_lbound=1, ungridded_ubound=3) - call dshr_fldList_add(fldsExport, 'Faxa_rainl_wiso', ungridded_lbound=1, ungridded_ubound=3) - call dshr_fldList_add(fldsExport, 'Faxa_snowc_wiso', ungridded_lbound=1, ungridded_ubound=3) - call dshr_fldList_add(fldsExport, 'Faxa_snowl_wiso', ungridded_lbound=1, ungridded_ubound=3) - call dshr_fldList_add(fldsExport, 'Faxa_shum_wiso' , ungridded_lbound=1, ungridded_ubound=3) - end if - - fldlist => fldsExport ! the head of the linked list - do while (associated(fldlist)) - call NUOPC_Advertise(exportState, standardName=fldlist%stdname, rc=rc) - if (ChkErr(rc,__LINE__,u_FILE_u)) return - call ESMF_LogWrite('(datm_comp_advertise): Fr_atm'//trim(fldList%stdname), ESMF_LOGMSG_INFO) - fldList => fldList%next - enddo - - end subroutine datm_datamode_jra55do_advertise - - !=============================================================================== - subroutine datm_datamode_jra55do_init_pointers(exportState, sdat, rc) - - ! input/output variables - type(ESMF_State) , intent(inout) :: exportState - type(shr_strdata_type) , intent(in) :: sdat - integer , intent(out) :: rc - - ! local variables - integer :: n - integer :: lsize - integer :: spatialDim ! number of dimension in mesh - integer :: numOwnedElements ! size of mesh - real(r8), pointer :: ownedElemCoords(:) ! mesh lat and lons - type(ESMF_StateItem_Flag) :: itemFlag - character(len=*), parameter :: subname='(datm_datamode_jra55do_init_pointers): ' - !------------------------------------------------------------------------------- - - rc = ESMF_SUCCESS - - lsize = sdat%model_lsize - - call ESMF_MeshGet(sdat%model_mesh, spatialDim=spatialDim, numOwnedElements=numOwnedElements, rc=rc) - if (ChkErr(rc,__LINE__,u_FILE_u)) return - allocate(ownedElemCoords(spatialDim*numOwnedElements)) - allocate(yc(numOwnedElements)) - call ESMF_MeshGet(sdat%model_mesh, ownedElemCoords=ownedElemCoords) - if (ChkErr(rc,__LINE__,u_FILE_u)) return - do n = 1,numOwnedElements - yc(n) = ownedElemCoords(2*n) - end do - - call shr_strdata_get_stream_pointer( sdat, 'Faxa_prrn' , strm_prrn , rc) - if (ChkErr(rc,__LINE__,u_FILE_u)) return - call shr_strdata_get_stream_pointer( sdat, 'Faxa_prsn' , strm_prsn , rc) - if (ChkErr(rc,__LINE__,u_FILE_u)) return - call shr_strdata_get_stream_pointer( sdat, 'Faxa_swdn' , strm_swdn , rc) - if (ChkErr(rc,__LINE__,u_FILE_u)) return - - call dshr_state_getfldptr(exportState, 'Sa_z' , fldptr1=Sa_z , rc=rc) - if (ChkErr(rc,__LINE__,u_FILE_u)) return - call dshr_state_getfldptr(exportState, 'Sa_tbot' , fldptr1=Sa_tbot , rc=rc) - if (ChkErr(rc,__LINE__,u_FILE_u)) return - call dshr_state_getfldptr(exportState, 'Sa_pbot' , fldptr1=Sa_pbot , rc=rc) - if (ChkErr(rc,__LINE__,u_FILE_u)) return - call dshr_state_getfldptr(exportState, 'Sa_pslv' , fldptr1=Sa_pslv , rc=rc) - if (ChkErr(rc,__LINE__,u_FILE_u)) return - call dshr_state_getfldptr(exportState, 'Sa_ptem' , fldptr1=Sa_ptem , rc=rc) - if (ChkErr(rc,__LINE__,u_FILE_u)) return - call dshr_state_getfldptr(exportState, 'Sa_shum' , fldptr1=Sa_shum , rc=rc) - if (ChkErr(rc,__LINE__,u_FILE_u)) return - call dshr_state_getfldptr(exportState, 'Sa_dens' , fldptr1=Sa_dens , rc=rc) - if (ChkErr(rc,__LINE__,u_FILE_u)) return - call dshr_state_getfldptr(exportState, 'Faxa_rainc' , fldptr1=Faxa_rainc , rc=rc) - if (ChkErr(rc,__LINE__,u_FILE_u)) return - call dshr_state_getfldptr(exportState, 'Faxa_rainl' , fldptr1=Faxa_rainl , rc=rc) - if (ChkErr(rc,__LINE__,u_FILE_u)) return - call dshr_state_getfldptr(exportState, 'Faxa_snowc' , fldptr1=Faxa_snowc , rc=rc) - if (ChkErr(rc,__LINE__,u_FILE_u)) return - call dshr_state_getfldptr(exportState, 'Faxa_snowl' , fldptr1=Faxa_snowl , rc=rc) - if (ChkErr(rc,__LINE__,u_FILE_u)) return - call dshr_state_getfldptr(exportState, 'Faxa_swvdr' , fldptr1=Faxa_swvdr , rc=rc) - if (ChkErr(rc,__LINE__,u_FILE_u)) return - call dshr_state_getfldptr(exportState, 'Faxa_swvdf' , fldptr1=Faxa_swvdf , rc=rc) - if (ChkErr(rc,__LINE__,u_FILE_u)) return - call dshr_state_getfldptr(exportState, 'Faxa_swndr' , fldptr1=Faxa_swndr , rc=rc) - if (ChkErr(rc,__LINE__,u_FILE_u)) return - call dshr_state_getfldptr(exportState, 'Faxa_swndf' , fldptr1=Faxa_swndf , rc=rc) - if (ChkErr(rc,__LINE__,u_FILE_u)) return - call dshr_state_getfldptr(exportState, 'Faxa_swnet' , fldptr1=Faxa_swnet , rc=rc) - if (ChkErr(rc,__LINE__,u_FILE_u)) return - - call ESMF_StateGet(exportState, 'Faxa_ndep', itemFlag, rc=rc) - if (ChkErr(rc,__LINE__,u_FILE_u)) return - if (itemflag /= ESMF_STATEITEM_NOTFOUND) then - call dshr_state_getfldptr(exportState, 'Faxa_ndep', fldptr2=Faxa_ndep, rc=rc) - if (ChkErr(rc,__LINE__,u_FILE_u)) return - end if - - ! erro check - if (.not. associated(strm_prrn) .or. .not. associated(strm_prsn) .or. .not. associated(strm_swdn)) then - call shr_sys_abort(trim(subname)//'ERROR: prrn, prsn and swdn must be in streams for JRA55-do') - endif - - end subroutine datm_datamode_jra55do_init_pointers - - !=============================================================================== - subroutine datm_datamode_jra55do_advance(exportstate, target_ymd, target_tod, model_calendar, rc) - - ! input/output variables - type(ESMF_State) , intent(inout) :: exportState - integer , intent(in) :: target_ymd - integer , intent(in) :: target_tod - character(len=*) , intent(in) :: model_calendar - integer , intent(out) :: rc - - ! local variables - integer :: n - integer :: lsize - real(R8) :: avg_alb ! average albedo - real(R8) :: rday ! elapsed day - real(R8) :: cosFactor ! cosine factor - character(len=*), parameter :: subname='(datm_datamode_jra55do_advance): ' - !------------------------------------------------------------------------------- - - rc = ESMF_SUCCESS - - lsize = size(Sa_z) - - call shr_cal_date2julian(target_ymd, target_tod, rday, model_calendar) - rday = mod((rday - 1.0_R8),365.0_R8) - cosfactor = cos((2.0_R8*SHR_CONST_PI*rday)/365 - phs_c0) - - do n = 1,lsize - Sa_z(n) = 10.0_R8 - Sa_pbot(n) = Sa_pslv(n) - Sa_ptem(n) = Sa_tbot(n) - - ! density computation for JRA55-do forcing - Sa_dens(n) = Sa_pbot(n)/(rdair*Sa_tbot(n)*(1 + 0.608*Sa_shum(n))) - - ! precipitation data - Faxa_rainc(n) = 0.0_R8 ! default zero - Faxa_snowc(n) = 0.0_R8 - Faxa_snowl(n) = strm_prsn(n) ! Snowfall flux - Faxa_rainl(n) = strm_prrn(n) ! Rainfall flux - - ! radiation data - fabricate required swdn components from net swdn - Faxa_swvdr(n) = strm_swdn(n)*(0.28_R8) - Faxa_swndr(n) = strm_swdn(n)*(0.31_R8) - Faxa_swvdf(n) = strm_swdn(n)*(0.24_R8) - Faxa_swndf(n) = strm_swdn(n)*(0.17_R8) - - ! radiation data - compute net short-wave based on LY08 latitudinally-varying albedo - avg_alb = ( 0.069 - 0.011*cos(2.0_R8*yc(n)*degtorad ) ) - Faxa_swnet(n) = strm_swdn(n)*(1.0_R8 - avg_alb) - enddo ! lsize - - if (associated(Faxa_ndep)) then - ! convert ndep flux to units of kgN/m2/s (input is in gN/m2/s) - Faxa_ndep(:,:) = Faxa_ndep(:,:) / 1000._r8 - end if - - end subroutine datm_datamode_jra55do_advance - -end module datm_datamode_jra55do_mod diff --git a/CDEPS/patches/atm_comp_nuopc.F90.patch b/CDEPS/patches/atm_comp_nuopc.F90.patch deleted file mode 100644 index bf02b1e..0000000 --- a/CDEPS/patches/atm_comp_nuopc.F90.patch +++ /dev/null @@ -1,75 +0,0 @@ -# Copyright ACCESS-NRI and contributors. See the top-level COPYRIGHT file for details. -# SPDX-License-Identifier: Apache-2.0 - -diff --git a/datm/atm_comp_nuopc.F90 b/datm/atm_comp_nuopc.F90 -index b74e0d3..bb31c22 100644 ---- a/datm/atm_comp_nuopc.F90 -+++ b/datm/atm_comp_nuopc.F90 -@@ -47,6 +47,10 @@ module cdeps_datm_comp - use datm_datamode_jra_mod , only : datm_datamode_jra_init_pointers - use datm_datamode_jra_mod , only : datm_datamode_jra_advance - -+ use datm_datamode_jra55do_mod , only : datm_datamode_jra55do_advertise -+ use datm_datamode_jra55do_mod , only : datm_datamode_jra55do_init_pointers -+ use datm_datamode_jra55do_mod , only : datm_datamode_jra55do_advance -+ - use datm_datamode_clmncep_mod , only : datm_datamode_clmncep_advertise - use datm_datamode_clmncep_mod , only : datm_datamode_clmncep_init_pointers - use datm_datamode_clmncep_mod , only : datm_datamode_clmncep_advance -@@ -355,6 +359,7 @@ contains - if ( trim(datamode) == 'CORE2_NYF' .or. & - trim(datamode) == 'CORE2_IAF' .or. & - trim(datamode) == 'CORE_IAF_JRA' .or. & -+ trim(datamode) == 'JRA55do' .or. & - trim(datamode) == 'CLMNCEP' .or. & - trim(datamode) == 'CPLHIST' .or. & - trim(datamode) == 'GEFS' .or. & -@@ -375,6 +380,10 @@ contains - call datm_datamode_jra_advertise(exportState, fldsExport, flds_scalar_name, & - flds_co2, flds_wiso, flds_presaero, flds_presndep, rc) - if (ChkErr(rc,__LINE__,u_FILE_u)) return -+ case ('JRA55do') -+ call datm_datamode_jra55do_advertise(exportState, fldsExport, flds_scalar_name, & -+ flds_co2, flds_wiso, flds_presaero, flds_presndep, rc) -+ if (ChkErr(rc,__LINE__,u_FILE_u)) return - case ('CLMNCEP') - call datm_datamode_clmncep_advertise(exportState, fldsExport, flds_scalar_name, & - flds_co2, flds_wiso, flds_presaero, flds_presndep, flds_preso3, rc) -@@ -623,6 +632,9 @@ contains - case('CORE_IAF_JRA') - call datm_datamode_jra_init_pointers(exportState, sdat, rc) - if (ChkErr(rc,__LINE__,u_FILE_u)) return -+ case('JRA55do') -+ call datm_datamode_jra55do_init_pointers(exportState, sdat, rc) -+ if (ChkErr(rc,__LINE__,u_FILE_u)) return - case('CLMNCEP') - call datm_datamode_clmncep_init_pointers(importState, exportState, sdat, rc) - if (ChkErr(rc,__LINE__,u_FILE_u)) return -@@ -645,7 +657,7 @@ contains - call shr_get_rpointer_name(gcomp, 'atm', target_ymd, target_tod, rpfile, 'read', rc) - if (ChkErr(rc,__LINE__,u_FILE_u)) return - select case (trim(datamode)) -- case('CORE2_NYF','CORE2_IAF','CORE_IAF_JRA','CLMNCEP','CPLHIST','ERA5','GEFS','SIMPLE') -+ case('CORE2_NYF','CORE2_IAF','CORE_IAF_JRA','JRA55do','CLMNCEP','CPLHIST','ERA5','GEFS','SIMPLE') - call dshr_restart_read(restfilm, rpfile, logunit, my_task, mpicom, sdat, rc) - if (ChkErr(rc,__LINE__,u_FILE_u)) return - case default -@@ -688,6 +700,9 @@ contains - case('CORE_IAF_JRA') - call datm_datamode_jra_advance(exportstate, target_ymd, target_tod, sdat%model_calendar, rc) - if (ChkErr(rc,__LINE__,u_FILE_u)) return -+ case('JRA55do') -+ call datm_datamode_jra55do_advance(exportstate, target_ymd, target_tod, sdat%model_calendar, rc) -+ if (ChkErr(rc,__LINE__,u_FILE_u)) return - case('CLMNCEP') - call datm_datamode_clmncep_advance(mainproc, logunit, mpicom, rc) - if (ChkErr(rc,__LINE__,u_FILE_u)) return -@@ -716,7 +731,7 @@ contains - call shr_get_rpointer_name(gcomp, 'atm', target_ymd, target_tod, rpfile, 'write', rc) - if (ChkErr(rc,__LINE__,u_FILE_u)) return - select case (trim(datamode)) -- case('CORE2_NYF','CORE2_IAF','CORE_IAF_JRA','CLMNCEP','CPLHIST','ERA5','GEFS','SIMPLE') -+ case('CORE2_NYF','CORE2_IAF','CORE_IAF_JRA','JRA55do','CLMNCEP','CPLHIST','ERA5','GEFS','SIMPLE') - call dshr_restart_write(rpfile, case_name, 'datm', inst_suffix, target_ymd, target_tod, logunit, & - my_task, sdat, rc) - if (ChkErr(rc,__LINE__,u_FILE_u)) return diff --git a/CMEPS/CMEPS b/CMEPS/CMEPS index bd3ff83..c9e2fae 160000 --- a/CMEPS/CMEPS +++ b/CMEPS/CMEPS @@ -1 +1 @@ -Subproject commit bd3ff83126516a16263fc7c4c16bbdeb4bd753b3 +Subproject commit c9e2fae24fd49bd0bc522a53ffad95648d9a9f13 diff --git a/CMEPS/CMakeLists.txt b/CMEPS/CMakeLists.txt index 9d628e4..e902008 100644 --- a/CMEPS/CMakeLists.txt +++ b/CMEPS/CMakeLists.txt @@ -14,7 +14,13 @@ if(OpenMP_Fortran_FOUND) target_link_libraries(ACCESS3_cmeps PRIVATE OpenMP::OpenMP_Fortran) endif() target_sources(ACCESS3_cmeps PRIVATE + CMEPS/cesm/share_wrappers/wtracers_mod.F90 CMEPS/cesm/flux_atmocn/shr_flux_mod.F90 + CMEPS/cesm/flux_atmocn/flux_atmocn_COARE_mod.F90 + CMEPS/cesm/flux_atmocn/flux_atmocn_Diurnal_mod.F90 + CMEPS/cesm/flux_atmocn/flux_atmocn_Large.F90 + CMEPS/cesm/flux_atmocn/flux_atmocn_UA_mod.F90 + CMEPS/cesm/flux_atmocn/flux_atmocn_driver_mod.F90 CMEPS/mediator/med_phases_history_mod.F90 CMEPS/mediator/med_phases_restart_mod.F90 CMEPS/mediator/med_map_mod.F90 @@ -29,6 +35,7 @@ target_sources(ACCESS3_cmeps PRIVATE CMEPS/mediator/med_merge_mod.F90 CMEPS/mediator/med_constants_mod.F90 CMEPS/mediator/med_kind_mod.F90 + CMEPS/mediator/esmFldsExchange_access_mod.F90 CMEPS/mediator/esmFldsExchange_ufs_mod.F90 CMEPS/mediator/med_phases_prep_lnd_mod.F90 CMEPS/mediator/med_phases_prep_atm_mod.F90 @@ -49,6 +56,7 @@ target_sources(ACCESS3_cmeps PRIVATE CMEPS/mediator/med_phases_post_glc_mod.F90 CMEPS/mediator/med_phases_post_rof_mod.F90 CMEPS/mediator/med_phases_post_wav_mod.F90 + CMEPS/mediator/med_field_info_mod.F90 ) ## NUOPC cap share @@ -62,6 +70,7 @@ target_sources(ACCESS3_nuopc_cap_share PRIVATE CMEPS/cesm/nuopc_cap_share/driver_pio_mod.F90 CMEPS/cesm/nuopc_cap_share/esm_utils_mod.F90 CMEPS/cesm/nuopc_cap_share/glc_elevclass_mod.F90 + CMEPS/cesm/nuopc_cap_share/shr_lnd2rof_tracers_mod.F90 ) @@ -114,3 +123,4 @@ install(EXPORT Access3Sharenuopc_cap_share_Targets NAMESPACE Access3:: DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/Access3Share ) + diff --git a/CMakeLists.txt b/CMakeLists.txt index b76f41e..1b22b39 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -40,7 +40,6 @@ include(GNUInstallDirs) # Include some custom cmake modules include(FortranLib) -include(AddPatchedSource) # Common compiler flags and definitions if(CMAKE_Fortran_COMPILER_ID MATCHES "GNU") diff --git a/cmake/Access3ShareConfig.cmake.in b/cmake/Access3ShareConfig.cmake.in index 29f60e0..f08f1ed 100755 --- a/cmake/Access3ShareConfig.cmake.in +++ b/cmake/Access3ShareConfig.cmake.in @@ -56,9 +56,7 @@ include(CMakeFindDependencyMacro) list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}) -if (cdeps IN_LIST _required_components) - find_dependency(FoX) -endif() +find_dependency(FoX) find_dependency(PIO 2.5.3 REQUIRED COMPONENTS C Fortran) find_dependency(NetCDF 4.7.3 REQUIRED C Fortran) diff --git a/cmake/AddPatchedSource.cmake b/cmake/AddPatchedSource.cmake deleted file mode 100644 index 5859442..0000000 --- a/cmake/AddPatchedSource.cmake +++ /dev/null @@ -1,25 +0,0 @@ -# Copyright ACCESS-NRI and contributors. See the top-level COPYRIGHT file for details. -# SPDX-License-Identifier: Apache-2.0 - -# Apply a patch to a source file and add the resulting file to the sources of a -# given target. -function(add_patched_source TARGET FILE) - # This function makes the following assumptions: - # - patches are stored in ${CMAKE_CURRENT_SOURCE_DIR}/patches - # - all patches to a given file are kept in the same patch file - # - patch files are named ${FILE}.patch - - get_filename_component(filename ${FILE} NAME) - - add_custom_command( - OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${filename} - COMMAND ${CMAKE_COMMAND} - -Din_file:FILEPATH=${CMAKE_CURRENT_SOURCE_DIR}/${FILE} - -Dpatch_file:FILEPATH=${CMAKE_CURRENT_SOURCE_DIR}/patches/${filename}.patch - -Dout_file:FILEPATH=${CMAKE_CURRENT_BINARY_DIR}/${filename} - -P ${CMAKE_SOURCE_DIR}/cmake/PatchFile.cmake - DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${FILE} - ) - - target_sources(${TARGET} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/${filename}) -endfunction(add_patched_source) diff --git a/cmake/PatchFile.cmake b/cmake/PatchFile.cmake deleted file mode 100644 index c6d1738..0000000 --- a/cmake/PatchFile.cmake +++ /dev/null @@ -1,33 +0,0 @@ -# Copyright ACCESS-NRI and contributors. See the top-level COPYRIGHT file for details. -# SPDX-License-Identifier: Apache-2.0 - -# use GNU Patch from any platform - -if(WIN32) - # prioritize Git Patch on Windows as other Patches may be very old and incompatible. - find_package(Git) - if(Git_FOUND) - get_filename_component(GIT_DIR ${GIT_EXECUTABLE} DIRECTORY) - get_filename_component(GIT_DIR ${GIT_DIR} DIRECTORY) - endif() -endif() - -find_program(PATCH -NAMES patch -HINTS ${GIT_DIR} -PATH_SUFFIXES usr/bin -) - -if(NOT PATCH) - message(FATAL_ERROR "Did not find GNU Patch") -endif() - -execute_process(COMMAND ${PATCH} ${in_file} --input=${patch_file} --output=${out_file} --ignore-whitespace -TIMEOUT 15 -COMMAND_ECHO STDOUT -RESULT_VARIABLE ret -) - -if(NOT ret EQUAL 0) - message(FATAL_ERROR "Failed to apply patch ${patch_file} to ${in_file} with ${PATCH}") -endif() diff --git a/share/CESM_share b/share/CESM_share index b2fa120..1b15cc8 160000 --- a/share/CESM_share +++ b/share/CESM_share @@ -1 +1 @@ -Subproject commit b2fa120301f09323bfd3b7467a9b1fd13cf08ea3 +Subproject commit 1b15cc8542908190ba8caa7df323e035e54fe57d diff --git a/share/CMakeLists.txt b/share/CMakeLists.txt index d69c0eb..e19cdf4 100755 --- a/share/CMakeLists.txt +++ b/share/CMakeLists.txt @@ -27,6 +27,7 @@ target_sources(share PRIVATE CESM_share/src/nuopc_shr_methods.F90 CESM_share/src/shr_abort_mod.F90 CESM_share/src/shr_cal_mod.F90 + CESM_share/src/shr_const_mod.F90 CESM_share/src/shr_file_mod.F90 CESM_share/src/shr_kind_mod.F90 CESM_share/src/shr_log_mod.F90 @@ -44,11 +45,11 @@ target_sources(share PRIVATE CESM_share/src/shr_timer_mod.F90 CESM_share/src/shr_wv_sat_mod.F90 CESM_share/src/water_isotopes/water_isotopes.F90 + CESM_share/src/water_isotopes/shr_wtracers_mod.F90 # The following file is a stub. - stubs/mct_mod.F90 + CESM_share/src/stubs/access3/mct_mod.F90 ) -add_patched_source(share CESM_share/src/shr_const_mod.F90) if(CMAKE_Fortran_COMPILER_ID MATCHES "Intel") # CESM reduces the precision and increases speed for the following file @@ -129,3 +130,4 @@ install(EXPORT Access3Sharetiming_Targets NAMESPACE Access3:: DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/Access3Share ) + diff --git a/share/patches/shr_const_mod.F90.patch b/share/patches/shr_const_mod.F90.patch deleted file mode 100644 index 6d5d57a..0000000 --- a/share/patches/shr_const_mod.F90.patch +++ /dev/null @@ -1,21 +0,0 @@ -diff --git a/src/shr_const_mod.F90 b/src/shr_const_mod.F90 -index 8437190..bd4b687 100644 ---- a/src/shr_const_mod.F90 -+++ b/src/shr_const_mod.F90 -@@ -17,7 +17,7 @@ MODULE shr_const_mod - real(R8),parameter :: SHR_CONST_CDAY = 86400.0_R8 ! sec in calendar day ~ sec - real(R8),parameter :: SHR_CONST_SDAY = 86164.0_R8 ! sec in siderial day ~ sec - real(R8),parameter :: SHR_CONST_OMEGA = 2.0_R8*SHR_CONST_PI/SHR_CONST_SDAY ! earth rot ~ rad/sec -- real(R8),parameter :: SHR_CONST_REARTH = 6.37122e6_R8 ! radius of earth ~ m -+ real(R8),parameter :: SHR_CONST_REARTH = 6.371229e6_R8 ! radius of earth used by UM13 ~ m - real(R8),parameter :: SHR_CONST_G = 9.80616_R8 ! acceleration of gravity ~ m/s^2 - - real(R8),parameter :: SHR_CONST_STEBOL = 5.67e-8_R8 ! Stefan-Boltzmann constant ~ W/m^2/K^4 -@@ -87,7 +87,6 @@ contains - !----------------------------------------------------------------------------- - - elemental logical function shr_const_isspval(rval) --!$omp declare simd(shr_const_isspval) - - real(r8), intent(in) :: rval - diff --git a/share/stubs/mct_mod.F90 b/share/stubs/mct_mod.F90 deleted file mode 100644 index 4591721..0000000 --- a/share/stubs/mct_mod.F90 +++ /dev/null @@ -1,13 +0,0 @@ -module m_MCTWorld - implicit none - -contains - - subroutine init(ncomps, globalcomm, mycomms, myids) - integer, intent(in) :: ncomps - integer, intent(in) :: globalcomm - integer, dimension(:), pointer :: mycomms - integer, dimension(:), pointer :: myids - end subroutine init - -end module m_MCTWorld