Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
183 commits
Select commit Hold shift + click to select a range
37363ad
remove perf_mod dependancy
jedwards4b Jul 16, 2020
06a00b9
not yet working
jedwards4b Jul 16, 2020
db398b4
fix standalone build
jedwards4b Jul 21, 2020
b0820dc
update pio path
jedwards4b Jul 21, 2020
de999e6
add tskn, lwnet and wind speed, fix swnet
uturuncoglu Jul 27, 2020
eb8e465
more bld changes
jedwards4b Jul 27, 2020
b916a5d
check fields in the state before returning pointers
uturuncoglu Jul 27, 2020
44549e5
add test for ERA5
uturuncoglu Jul 28, 2020
6ac93fa
put extra log if it cannot find the field in the state
uturuncoglu Jul 29, 2020
067293e
Merge pull request #7 from ESCOMP/update_era5_v2
uturuncoglu Jul 29, 2020
5f9a655
bug fixes
Jul 30, 2020
317c8ae
first changes for 3d input capability
Aug 1, 2020
13a2708
updates to have DLND compset working and bfb
Aug 2, 2020
e7b4958
fix for fldptr return mode
uturuncoglu Aug 4, 2020
f5fef94
Merge pull request #10 from ESCOMP/fix_fldptr
uturuncoglu Aug 4, 2020
cb47276
addition of 3d functionality
Aug 5, 2020
6ed43c2
add fox as a submodule of cdeps
jedwards4b Aug 6, 2020
4f5499d
cleanup
Aug 6, 2020
54b6bb7
Merge branch 'master' into feature/bug_fixes
Aug 6, 2020
1c6624d
add fox submodule
jedwards4b Aug 6, 2020
fac382c
remove more t_barriers
jedwards4b Aug 6, 2020
13676a2
Merge pull request #12 from jedwards4b/add_fox_submodule
jedwards4b Aug 6, 2020
3bfc100
build fixes
jedwards4b Aug 7, 2020
a6a682a
update fox
jedwards4b Aug 7, 2020
7a0c37f
Create extbuild.yml
jedwards4b Aug 6, 2020
85f4ee2
untar pio
jedwards4b Aug 6, 2020
56784aa
no tabs allowed
jedwards4b Aug 6, 2020
17b9a45
add cdeps build
jedwards4b Aug 6, 2020
b355a68
try again
jedwards4b Aug 6, 2020
e4b1062
add esmf build
jedwards4b Aug 6, 2020
83c2a60
no tabs
jedwards4b Aug 6, 2020
dcc1d52
more workflow stuff
jedwards4b Aug 6, 2020
5759f6c
fix again
jedwards4b Aug 6, 2020
b2d5f3a
fix format
jedwards4b Aug 6, 2020
d17f05d
add :
jedwards4b Aug 6, 2020
f16271c
try again
jedwards4b Aug 6, 2020
6080602
try again
jedwards4b Aug 6, 2020
b2977c9
try again
jedwards4b Aug 6, 2020
e7581b9
try again
jedwards4b Aug 6, 2020
908f61d
redo esmf build
jedwards4b Aug 7, 2020
ba35a4b
redo esmf build
jedwards4b Aug 7, 2020
07c0ba9
redo esmf build
jedwards4b Aug 7, 2020
69683b9
put it together
jedwards4b Aug 7, 2020
4969e1d
tabs again
jedwards4b Aug 7, 2020
7eb7169
whitespace cleanup
jedwards4b Aug 7, 2020
b0fc9fe
reindent and try again
jedwards4b Aug 7, 2020
dd647f0
try a smaller piece
jedwards4b Aug 7, 2020
c47d196
fix indentation issues
jedwards4b Aug 7, 2020
516e500
more indentation issues
jedwards4b Aug 7, 2020
32cb41d
update fox cmake defaults
jedwards4b Aug 7, 2020
968b57c
try again
jedwards4b Aug 7, 2020
cda2c88
getting closer
jedwards4b Aug 7, 2020
c561e94
add pio build
jedwards4b Aug 7, 2020
3f972b8
add pnetcdf path
jedwards4b Aug 7, 2020
5daac89
add netcdf-fortran
jedwards4b Aug 7, 2020
08c67e9
fix syntax error
jedwards4b Aug 7, 2020
973bd40
find netcdf version
jedwards4b Aug 7, 2020
5195033
need netcdf-fortran 4.5.2
jedwards4b Aug 7, 2020
e6dc151
remove debug statement
jedwards4b Aug 7, 2020
b34d98d
another typo fixed
jedwards4b Aug 7, 2020
b116576
debug commit
jedwards4b Aug 7, 2020
88462dd
debug commit
jedwards4b Aug 7, 2020
34e4cea
update paths
jedwards4b Aug 7, 2020
981487d
restoring caches
jedwards4b Aug 7, 2020
dd95f0f
restoring caches
jedwards4b Aug 7, 2020
31e6767
add outputs
jedwards4b Aug 7, 2020
febee8e
add outputs
jedwards4b Aug 7, 2020
18294ea
add outputs
jedwards4b Aug 7, 2020
9d75383
Revert "add outputs"
jedwards4b Aug 7, 2020
59f7047
add outputs
jedwards4b Aug 7, 2020
d4bfc92
add outputs
jedwards4b Aug 7, 2020
e4aeaf9
one job?
jedwards4b Aug 7, 2020
9d8a59a
try again
jedwards4b Aug 7, 2020
654d660
now build cdeps
jedwards4b Aug 7, 2020
e937028
now build cdeps
jedwards4b Aug 7, 2020
06acde9
now build cdeps
jedwards4b Aug 7, 2020
42bcb08
add build flags
jedwards4b Aug 7, 2020
f172b16
add build flags
jedwards4b Aug 7, 2020
8de2f8d
add build flags
jedwards4b Aug 7, 2020
73dec14
add build flags
jedwards4b Aug 7, 2020
f38484d
add build flags
jedwards4b Aug 7, 2020
fbb0e1e
fix a real error
jedwards4b Aug 7, 2020
2fa1125
Merge pull request #13 from ESCOMP/add-github-actions
jedwards4b Aug 7, 2020
28c0644
more bug fixes
Aug 8, 2020
3e483ac
updates to latest cdeps
Aug 8, 2020
bfa92e3
more bug fixes
Aug 8, 2020
bb79a7f
Merge branch 'master' into feature/bug_fixes
jedwards4b Aug 8, 2020
339112c
Merge pull request #15 from ESCOMP/feature/bug_fixes
jedwards4b Aug 8, 2020
d7b8a4c
remove unused variables
jedwards4b Aug 8, 2020
5a1b060
more cleanup
jedwards4b Aug 8, 2020
b1b2697
changes to get 3d stream input working
Aug 10, 2020
246644a
clean up wav comp
jedwards4b Aug 10, 2020
9d716f9
more cleanup
jedwards4b Aug 10, 2020
1245cfa
more cleanup
jedwards4b Aug 10, 2020
f2126a3
fix errors
jedwards4b Aug 10, 2020
13c94c7
fix error
jedwards4b Aug 10, 2020
994aaa8
fix error
jedwards4b Aug 10, 2020
abd5508
fix error
jedwards4b Aug 10, 2020
dc2c91f
fix error
jedwards4b Aug 10, 2020
b798586
fix error
jedwards4b Aug 10, 2020
3db6586
fix error
jedwards4b Aug 10, 2020
b4e99c9
fix errors
jedwards4b Aug 10, 2020
7de813a
more fixes
jedwards4b Aug 10, 2020
8d55901
fix another issue
jedwards4b Aug 10, 2020
7eb6ede
use ymd instead of date
jedwards4b Aug 10, 2020
08ea63c
use ymd instead of date
jedwards4b Aug 10, 2020
23fedf3
replace bias_correction
jedwards4b Aug 10, 2020
cac4613
make esmf version env var
jedwards4b Aug 10, 2020
a680ed4
add versions to dependencies
jedwards4b Aug 10, 2020
e1f555f
fix workflow error
jedwards4b Aug 10, 2020
7c65629
fix workflow
jedwards4b Aug 10, 2020
fc1a331
Merge pull request #16 from ESCOMP/minimize_compiler_warnings
jedwards4b Aug 10, 2020
18b1d3b
merge to cdeps master
Aug 11, 2020
6a35dea
updates for documentation
Aug 11, 2020
db0a90e
Merge branch 'master' of https://github.com/ESCOMP/CDEPS
Aug 11, 2020
8ed166f
udpates for PR requests
Aug 11, 2020
60a7486
Merge branch 'master' into mvertens/cdeps3d_works
jedwards4b Aug 11, 2020
cfc5345
Merge pull request #19 from ESCOMP/mvertens/cdeps3d_works
jedwards4b Aug 11, 2020
6f33826
new stream_definition_xxx.xml
Aug 15, 2020
2023267
changes to fix aux_cdeps tests and bring in stream_cdeps.py and strea…
Aug 19, 2020
45b7a85
fixed bugs
Aug 19, 2020
d808b7c
addressed PR issues raised by Jim Edwards
Aug 20, 2020
e99ec4f
Merge pull request #21 from ESCOMP/new_stream_schema
jedwards4b Aug 20, 2020
2480ebb
fix find compiler with cime
jedwards4b Aug 26, 2020
82a2974
improve the build, remove hardcoded path
jedwards4b Sep 18, 2020
b9a3fa8
Merge pull request #27 from ESCOMP/build_improvements
jedwards4b Sep 25, 2020
8508f59
build improvements
jedwards4b Sep 25, 2020
d4394fa
fixed bug in drof JRA55 specfication for mesh file
Oct 2, 2020
e9a9660
fix GPTL issue
Oct 12, 2020
977bfda
fix stdout format issue
jedwards4b Oct 30, 2020
2c2a2be
add code to avoid clashes when building multiple cases at once
jedwards4b Nov 16, 2020
a15b267
Merge branch 'master' of https://github.com/ESCOMP/CDEPS
jedwards4b Nov 16, 2020
dc6e3f6
increase wait time
jedwards4b Nov 16, 2020
8f0a405
simplify locking
jedwards4b Nov 16, 2020
6de6963
fix issue with CMAKE_INSTALL_PATH
jedwards4b Nov 17, 2020
3726ebb
cleanup;
jedwards4b Nov 17, 2020
3985a73
fix for pgi build
jedwards4b Nov 24, 2020
f9da2a6
feature/perf_updates
Dec 4, 2020
c669b39
Merge pull request #33 from ESCOMP/feature/perf_updates
jedwards4b Dec 7, 2020
1bba9f7
Merge branch 'emc/develop' of https://github.com/NOAA-EMC/CDEPS into …
binli2337 Dec 9, 2020
3e6b717
fix for finding PIO
Dec 11, 2020
d94eeca
fix docn if the stream only provides SST
Dec 11, 2020
6f88a90
fixes to get datm working with dynamic fraction calculation in clm
Jan 4, 2021
b38ae62
changes to get docn working with dynamic fraction calculation if mask…
Jan 4, 2021
5808cb1
fix cmake build to work with HAFS
Jan 7, 2021
2cec07f
update cmake files for dice, dlnd, drof and dwav
Jan 8, 2021
47d9ec1
update dependencies
Jan 8, 2021
0831048
fixed problem for single point cases - no mapping file will be create…
Jan 10, 2021
1739751
fixed problems related to taxmode and dtlimit for DATM%PTCLM versus j…
Jan 10, 2021
f4bec30
finished adding datm_datamode_cplhist_mod.F90
Jan 10, 2021
dd2e5d2
changes to fix memory growth problem
Jan 11, 2021
a843a9b
Merge commit 'dd2e5d2' into mvertens/dynfrac
Jan 11, 2021
f286f51
removed debug write statement
Jan 11, 2021
e66fde4
updated missing stream mesh files
Jan 13, 2021
2e77890
fixed creation of ocean mask/frac when it needs to be created
Jan 14, 2021
c6be719
Merge branch 'master' into feature/hafs_cdeps_pr
uturuncoglu Jan 14, 2021
c39dc6a
add only clause i dshr_fldlist_mod and dshr_stream_mod
jedwards4b Jan 19, 2021
bf4f9da
add only to dshr_dfield_mod
jedwards4b Jan 19, 2021
1a5f6a1
add only clause to dshr_tinterp_mod
jedwards4b Jan 19, 2021
fc49812
add only to dshr_strdata_mod
jedwards4b Jan 19, 2021
92ec4b6
Merge pull request #41 from ESCOMP/mvertens/dynfrac
mvertens Jan 19, 2021
ee60a78
Merge branch 'master' into feature/hafs_cdeps_pr
uturuncoglu Jan 19, 2021
c64e7a2
add only clause to dshr_methods_mod
jedwards4b Jan 19, 2021
5374de6
add only clause
jedwards4b Jan 19, 2021
44b8864
add more only clauses
jedwards4b Jan 19, 2021
0ef2a44
add more only clauses
jedwards4b Jan 19, 2021
736766b
add more only clauses
jedwards4b Jan 19, 2021
63f1654
add more only clauses
jedwards4b Jan 19, 2021
64337ef
add more only clauses
jedwards4b Jan 19, 2021
4dc756e
add more only clauses
jedwards4b Jan 19, 2021
ca70972
add more only clauses
jedwards4b Jan 19, 2021
5393a13
Merge branch 'master' of https://github.com/ESCOMP/CDEPS into add_onl…
jedwards4b Jan 19, 2021
05458c0
more only clauses
jedwards4b Jan 19, 2021
bc84182
more only clauses
jedwards4b Jan 19, 2021
0b3a68e
Merge pull request #43 from jedwards4b/add_only_clause
jedwards4b Jan 19, 2021
1d8b5ce
fix make build under CESM
Jan 20, 2021
7cc6735
Merge branch 'master' into feature/hafs_cdeps_pr
uturuncoglu Jan 20, 2021
c138337
more fix for cmake build under CESM
Jan 20, 2021
5da53f4
fix the standalone build outside of any application
Jan 20, 2021
3b1ec5a
Merge pull request #40 from hafs-community/feature/hafs_cdeps_pr
uturuncoglu Jan 20, 2021
3937c32
Merge branch 'master' of https://github.com/ESCOMP/CDEPS into emc/dev…
binli2337 Jan 21, 2021
c4583cf
Updated atm_comp_nuopc.F90,datm_datamode_cfsr_mod.F90 and CMakeLists.…
binli2337 Jan 26, 2021
c2e7807
Merge branch 'emc/develop' into feature/update01
binli2337 Jan 26, 2021
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
59 changes: 52 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,22 @@ list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)

message("CMAKE_MODULE_PATH is ${CMAKE_MODULE_PATH}")

find_package(ESMF REQUIRED)
if (DEFINED PIO)
set(PIO_PATH ${PIO})
if (TARGET esmf)
message("Target esmf is already found. Skip find_package ...")
else()
set(PIO_PATH $ENV{PIO})
find_package(ESMF REQUIRED)
endif()

if (DEFINED ENV{PIO_ROOT})
message("PIO_ROOT is $ENV{PIO_ROOT}")
else()
if (DEFINED PIO)
set(PIO_PATH ${PIO})
else()
set(PIO_PATH $ENV{PIO})
endif()
find_package(PIO REQUIRED COMPONENT C Fortran PATH ${PIO_PATH})
endif()
find_package(PIO REQUIRED COMPONENT C Fortran PATH ${PIO_PATH})

if (NOT DEFINED MPILIB OR NOT ${MPILIB} STREQUAL "mpi-serial")
find_package(MPI REQUIRED)
Expand All @@ -53,5 +62,41 @@ foreach(COMP datm dice dlnd docn drof dwav)
add_subdirectory("${COMP}")
endforeach(COMP)

install(TARGETS streams dshr
LIBRARY DESTINATION lib)
target_include_directories(streams PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/share>
$<INSTALL_INTERFACE:mod>)
target_include_directories(streams PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/fox/include>
$<INSTALL_INTERFACE:mod>)
target_include_directories(dshr PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/share>
$<INSTALL_INTERFACE:mod>)
target_include_directories(dshr PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/fox/include>
$<INSTALL_INTERFACE:mod>)
target_include_directories(dshr PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/streams>
$<INSTALL_INTERFACE:mod>)

foreach(COMP datm dice dlnd docn drof dwav)
target_include_directories(${COMP} PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/share>
$<INSTALL_INTERFACE:mod>)
target_include_directories(${COMP} PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/streams>
$<INSTALL_INTERFACE:mod>)
target_include_directories(${COMP} PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/dshr>
$<INSTALL_INTERFACE:mod>)

install(TARGETS ${COMP}
EXPORT ${COMP}
LIBRARY DESTINATION lib
COMPONENT Library)
install(EXPORT ${COMP}
DESTINATION lib/cmake)
endforeach(COMP)

foreach(DEPS streams dshr cdeps_share FoX_dom FoX_wxml FoX_sax FoX_common FoX_utils FoX_fsys)
if(NOT BLD_STANDALONE AND ${DEPS} STREQUAL "cdeps_share")
continue()
endif()
install(TARGETS ${DEPS}
EXPORT ${DEPS}
LIBRARY DESTINATION lib
COMPONENT Library)
install(EXPORT ${DEPS}
DESTINATION lib/cmake)
endforeach(COMP)
9 changes: 7 additions & 2 deletions cime_config/stream_cdeps.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,12 @@ def create_stream_xml(self, stream_names, case, streams_xml_file, data_list_file
stream_datafiles = child.xml_element.text
stream_datafiles = self._resolve_values(case, stream_datafiles)
if 'first_year' in child.xml_element.attrib and 'last_year' in child.xml_element.attrib:
stream_year_first= int(child.xml_element.get('first_year'))
stream_year_last = int(child.xml_element.get('last_year'))
value = child.xml_element.get('first_year')
value = self._resolve_values(case, value)
stream_year_first= int(value)
value = child.xml_element.get('last_year')
value = self._resolve_values(case, value)
stream_year_last = int(value)
year_first = max(stream_year_first, data_year_first)
year_last = min(stream_year_last, data_year_last)
stream_datafiles = self._sub_paths(stream_datafiles, year_first, year_last)
Expand All @@ -117,6 +121,7 @@ def create_stream_xml(self, stream_names, case, streams_xml_file, data_list_file
or node_name == 'stream_taxmode'
or node_name == 'stream_dtlimit'):
attributes['model_grid'] = case.get_value("GRID")
attributes['compset'] = case.get_value("COMPSET")
value = self._get_value_match(node, node_name[7:], attributes=attributes)
value = self._resolve_values(case, value)
value = value.strip()
Expand Down
19 changes: 12 additions & 7 deletions cime_config/streams_v2.0.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,20 @@
<!-- ======================== -->

<xs:attribute name="name" type="xs:string"/>
<xs:attribute name="first_year" type="xs:integer"/>
<xs:attribute name="last_year" type="xs:integer"/>
<xs:attribute name="first_year" type="xs:string"/>
<xs:attribute name="last_year" type="xs:string"/>
<xs:attribute name="model_grid" type="xs:string"/>
<xs:attribute name="compset" type="xs:string"/>
<xs:attribute name="version" type="xs:string"/>

<!-- ======================== -->
<!-- simple elements -->
<!-- ======================== -->

<xs:element name="stream_lev_dimname" type="xs:string"/>
<xs:element name="stream_year_first" type="xs:string"/>
<xs:element name="stream_year_last" type="xs:string"/>
<xs:element name="stream_year_align" type="xs:string"/>
<xs:element name="stream_year_first" type="xs:string"/>
<xs:element name="stream_year_last" type="xs:string"/>
<xs:element name="stream_year_align" type="xs:string"/>
<xs:element name="stream_offset" type="xs:integer"/>

<xs:element name="stream_readmode">
Expand All @@ -32,13 +33,13 @@

<xs:element name="stream_vectors">
<xs:simpleType>
<xs:list itemType="xs:string"/>
<xs:list itemType="xs:string"/>
</xs:simpleType>
</xs:element>

<xs:element name="var">
<xs:simpleType>
<xs:list itemType="xs:string"/>
<xs:list itemType="xs:string"/>
</xs:simpleType>
</xs:element>

Expand Down Expand Up @@ -76,6 +77,7 @@
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute name="model_grid" type="xs:string" />
<xs:attribute name="compset" type="xs:string" />
</xs:extension>
</xs:simpleContent>
</xs:complexType>
Expand All @@ -100,6 +102,7 @@
<xs:simpleContent>
<xs:extension base="taxmodeType">
<xs:attribute ref="model_grid"/>
<xs:attribute ref="compset"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
Expand All @@ -125,6 +128,7 @@
<xs:simpleContent>
<xs:extension base="mapalgoType">
<xs:attribute ref="model_grid"/>
<xs:attribute ref="compset"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
Expand All @@ -142,6 +146,7 @@
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute ref="model_grid"/>
<xs:attribute ref="compset"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
Expand Down
36 changes: 24 additions & 12 deletions datm/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,28 @@
project(datm Fortran)
set(SRCFILES atm_comp_nuopc.F90
datm_datamode_clmncep_mod.F90
datm_datamode_cplhist_mod.F90
datm_datamode_core2_mod.F90
datm_datamode_jra_mod.F90
datm_datamode_cfsr_mod.F90
datm_datamode_era5_mod.F90)

add_library(datm atm_comp_nuopc.F90
datm_datamode_clmncep_mod.F90
datm_datamode_core2_mod.F90
datm_datamode_jra_mod.F90
datm_datamode_cfsr_mod.F90
datm_datamode_era5_mod.F90)
foreach(FILE ${SRCFILES})
if(EXISTS "${CASEROOT}/SourceMods/src.datm/${FILE}")
list(REMOVE_ITEM SRCFILES ${FILE})
list(APPEND SRCFILES "${CASEROOT}/SourceMods/src.datm/${FILE}")
message("Using ${FILE} from ${CASEROOT}/SourceMods/src.datm")
endif()
endforeach()

message("DATM srcfiles are ${SRCFILES}")

add_library(datm ${SRCFILES})

add_dependencies(datm dshr streams)
target_include_directories (datm PUBLIC ${ESMF_F90COMPILEPATHS})
target_include_directories (datm PUBLIC "${CMAKE_BINARY_DIR}/dshr")
target_include_directories (datm PUBLIC "${CMAKE_SOURCE_DIR}")
target_include_directories (datm PUBLIC "${CMAKE_BINARY_DIR}/share")
target_include_directories (datm PUBLIC "${CMAKE_BINARY_DIR}/streams")
target_include_directories (datm PUBLIC "${PIO_Fortran_INCLUDE_DIR}")
target_include_directories (datm PRIVATE ${ESMF_F90COMPILEPATHS})
target_include_directories (datm PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/dshr)
target_include_directories (datm PRIVATE ${CMAKE_SOURCE_DIR})
target_include_directories (datm PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/share)
target_include_directories (datm PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/streams)
target_include_directories (datm PRIVATE ${PIO_Fortran_INCLUDE_DIR})
43 changes: 42 additions & 1 deletion datm/atm_comp_nuopc.F90
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,15 @@ module atm_comp_nuopc
! This is the NUOPC cap for DATM
!----------------------------------------------------------------------------

use ESMF
use ESMF , only : ESMF_Mesh, ESMF_GridComp, ESMF_SUCCESS, ESMF_LogWrite
use ESMF , only : ESMF_GridCompSetEntryPoint, ESMF_METHOD_INITIALIZE
use ESMF , only : ESMF_MethodRemove, ESMF_State, ESMF_Clock, ESMF_TimeInterval
use ESMF , only : ESMF_State, ESMF_Field, ESMF_LOGMSG_INFO, ESMF_ClockGet
use ESMF , only : ESMF_Time, ESMF_Alarm, ESMF_TimeGet, ESMF_TimeInterval
use ESMF , only : operator(+), ESMF_TimeIntervalGet, ESMF_ClockGetAlarm
use ESMF , only : ESMF_AlarmIsRinging, ESMF_AlarmRingerOff, ESMF_StateGet
use ESMF , only : ESMF_FieldGet, ESMF_MAXSTR
use ESMF , only : ESMF_TraceRegionEnter, ESMF_TraceRegionExit
use NUOPC , only : NUOPC_CompDerive, NUOPC_CompSetEntryPoint, NUOPC_CompSpecialize
use NUOPC , only : NUOPC_CompAttributeGet, NUOPC_Advertise
use NUOPC_Model , only : model_routine_SS => SetServices
Expand All @@ -26,21 +34,31 @@ module atm_comp_nuopc
use dshr_mod , only : dshr_orbital_init, dshr_orbital_update
use dshr_dfield_mod , only : dfield_type, dshr_dfield_add, dshr_dfield_copy
use dshr_fldlist_mod , only : fldlist_type, dshr_fldlist_add, dshr_fldlist_realize

use datm_datamode_core2_mod , only : datm_datamode_core2_advertise
use datm_datamode_core2_mod , only : datm_datamode_core2_init_pointers
use datm_datamode_core2_mod , only : datm_datamode_core2_advance
use datm_datamode_core2_mod , only : datm_datamode_core2_restart_write
use datm_datamode_core2_mod , only : datm_datamode_core2_restart_read

use datm_datamode_jra_mod , only : datm_datamode_jra_advertise
use datm_datamode_jra_mod , only : datm_datamode_jra_init_pointers
use datm_datamode_jra_mod , only : datm_datamode_jra_advance
use datm_datamode_jra_mod , only : datm_datamode_jra_restart_write
use datm_datamode_jra_mod , only : datm_datamode_jra_restart_read

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
use datm_datamode_clmncep_mod , only : datm_datamode_clmncep_restart_write
use datm_datamode_clmncep_mod , only : datm_datamode_clmncep_restart_read

use datm_datamode_cplhist_mod , only : datm_datamode_cplhist_advertise
use datm_datamode_cplhist_mod , only : datm_datamode_cplhist_init_pointers
use datm_datamode_cplhist_mod , only : datm_datamode_cplhist_advance
use datm_datamode_cplhist_mod , only : datm_datamode_cplhist_restart_write
use datm_datamode_cplhist_mod , only : datm_datamode_cplhist_restart_read

use datm_datamode_era5_mod , only : datm_datamode_era5_advertise
use datm_datamode_era5_mod , only : datm_datamode_era5_init_pointers
use datm_datamode_era5_mod , only : datm_datamode_era5_advance
Expand All @@ -52,6 +70,12 @@ module atm_comp_nuopc
use datm_datamode_cfsr_mod , only : datm_datamode_cfsr_restart_write
use datm_datamode_cfsr_mod , only : datm_datamode_cfsr_restart_read

use datm_datamode_cfsr_mod , only : datm_datamode_cfsr_advertise
use datm_datamode_cfsr_mod , only : datm_datamode_cfsr_init_pointers
use datm_datamode_cfsr_mod , only : datm_datamode_cfsr_advance
use datm_datamode_cfsr_mod , only : datm_datamode_cfsr_restart_write
use datm_datamode_cfsr_mod , only : datm_datamode_cfsr_restart_read

implicit none
private ! except

Expand Down Expand Up @@ -289,6 +313,7 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc)
trim(datamode) == 'CORE2_IAF' .or. &
trim(datamode) == 'CORE_IAF_JRA' .or. &
trim(datamode) == 'CLMNCEP' .or. &
trim(datamode) == 'CPLHIST' .or. &
trim(datamode) == 'CFSR' .or. &
trim(datamode) == 'ERA5') then
else
Expand All @@ -308,6 +333,10 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc)
call datm_datamode_clmncep_advertise(exportState, fldsExport, flds_scalar_name, &
flds_co2, flds_wiso, flds_presaero, rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
case ('CPLHIST')
call datm_datamode_cplhist_advertise(exportState, fldsExport, flds_scalar_name, &
flds_co2, flds_wiso, flds_presaero, rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
case ('ERA5')
call datm_datamode_era5_advertise(exportState, fldsExport, flds_scalar_name, rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
Expand Down Expand Up @@ -547,6 +576,9 @@ subroutine datm_comp_run(importState, exportState, target_ymd, target_tod, targe
case('CLMNCEP')
call datm_datamode_clmncep_init_pointers(importState, exportState, sdat, rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
case('CPLHIST')
call datm_datamode_cplhist_init_pointers(importState, exportState, sdat, rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
case('ERA5')
call datm_datamode_era5_init_pointers(exportState, sdat, rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
Expand All @@ -564,6 +596,8 @@ subroutine datm_comp_run(importState, exportState, target_ymd, target_tod, targe
call datm_datamode_jra_restart_read(restfilm, inst_suffix, logunit, my_task, mpicom, sdat)
case('CLMNCEP')
call datm_datamode_clmncep_restart_read(restfilm, inst_suffix, logunit, my_task, mpicom, sdat)
case('CPLHIST')
call datm_datamode_cplhist_restart_read(restfilm, inst_suffix, logunit, my_task, mpicom, sdat)
case('ERA5')
call datm_datamode_era5_restart_read(restfilm, inst_suffix, logunit, my_task, mpicom, sdat)
case('CFSR')
Expand Down Expand Up @@ -608,6 +642,9 @@ subroutine datm_comp_run(importState, exportState, target_ymd, target_tod, targe
case('CLMNCEP')
call datm_datamode_clmncep_advance(masterproc, logunit, mpicom, rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
case('CPLHIST')
call datm_datamode_cplhist_advance(masterproc, logunit, mpicom, rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
case('ERA5')
call datm_datamode_era5_advance(exportstate, masterproc, logunit, mpicom, target_ymd, &
target_tod, sdat%model_calendar, rc)
Expand All @@ -633,6 +670,10 @@ subroutine datm_comp_run(importState, exportState, target_ymd, target_tod, targe
call datm_datamode_clmncep_restart_write(case_name, inst_suffix, target_ymd, target_tod, &
logunit, my_task, sdat)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
case('CPLHIST')
call datm_datamode_cplhist_restart_write(case_name, inst_suffix, target_ymd, target_tod, &
logunit, my_task, sdat)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
case('ERA5')
call datm_datamode_era5_restart_write(case_name, inst_suffix, target_ymd, target_tod, &
logunit, my_task, sdat)
Expand Down
Loading