871 integer,
intent(in) :: icomp, localpet
872 integer,
intent(out) :: rc
874 character (len=*) :: source
876 TYPE (esmf_gridcomp) :: model
883 integer :: alarmcount(0:
nmodels)
885 integer (i8b) :: advancecount(0:
nmodels)
897 character (len=22) :: clockname(0:
nmodels)
898 character (len=22) :: directionstring(0:
nmodels)
899 character (len=22) :: timecurrstring(0:
nmodels)
900 character (len=22) :: timenextstring(0:
nmodels)
901 character (len=22) :: timeprevstring(0:
nmodels)
902 character (len=22) :: timestartstring(0:
nmodels)
903 character (len=22) :: timestopstring(0:
nmodels)
905 character (len=*),
parameter :: myfile = &
906 & __FILE__//
", clock_report"
908 TYPE (esmf_clock) :: clock(0:
nmodels)
909 TYPE (esmf_direction_flag) :: direction(0:
nmodels)
910 TYPE (esmf_timeinterval) :: runduration(0:
nmodels)
912 TYPE (esmf_time) :: currtime(0:
nmodels)
913 TYPE (esmf_time) :: prevtime(0:
nmodels)
914 TYPE (esmf_time) :: starttime(0:
nmodels)
915 TYPE (esmf_time) :: stoptime(0:
nmodels)
927 scale=1.0_dp/86400.0_dp
933 isactive=
models(i)%IsActive
937 CALL esmf_clockget (clock(i), &
939 & starttime = starttime(i), &
940 & stoptime = stoptime(i), &
941 & runduration = runduration(i), &
942 & runtimestepcount = runtimestepcount(i), &
943 & currtime = currtime(i), &
944 & prevtime = prevtime(i), &
945 & advancecount = advancecount(i), &
946 & alarmcount = alarmcount(i), &
947 & direction = direction(i), &
948 & name = clockname(i), &
950 IF (esmf_logfounderror(rctocheck=rc, &
951 & msg=esmf_logerr_passthru, &
956 IF (direction(i).eq.esmf_direction_forward)
THEN
957 directionstring(i)=
'FORWARD'
959 directionstring(i)=
'REVERSE'
961 clockinfo(i)%AdvanceCount=advancecount(i)
963 CALL esmf_timeget (starttime(i), &
964 & s_r8=timestart(i), &
965 & timestring=timestartstring(i), &
967 IF (esmf_logfounderror(rctocheck=rc, &
968 & msg=esmf_logerr_passthru, &
973 is=index(timestartstring(i),
'T')
974 IF (is.gt.0) timestartstring(i)(is:is)=
' '
976 CALL esmf_timeget (stoptime(i), &
977 & s_r8=timestop(i), &
978 & timestring=timestopstring(i), &
980 IF (esmf_logfounderror(rctocheck=rc, &
981 & msg=esmf_logerr_passthru, &
986 is=index(timestopstring(i),
'T')
987 IF (is.gt.0) timestopstring(i)(is:is)=
' '
989 CALL esmf_timeget (prevtime(i), &
990 & s_r8=timeprev(i), &
991 & timestring=timeprevstring(i), &
993 IF (esmf_logfounderror(rctocheck=rc, &
994 & msg=esmf_logerr_passthru, &
999 is=index(timeprevstring(i),
'T')
1000 IF (is.gt.0) timeprevstring(i)(is:is)=
' '
1002 CALL esmf_timeget (currtime(i), &
1003 & s_r8=timecurr(i), &
1004 & timestring=timecurrstring(i), &
1006 IF (esmf_logfounderror(rctocheck=rc, &
1007 & msg=esmf_logerr_passthru, &
1009 & file=myfile))
THEN
1012 is=index(timecurrstring(i),
'T')
1013 IF (is.gt.0) timecurrstring(i)(is:is)=
' '
1015 CALL esmf_timeget (currtime(i)+
timestep(i), &
1016 & s_r8=timenext(i), &
1017 & timestring=timenextstring(i), &
1019 IF (esmf_logfounderror(rctocheck=rc, &
1020 & msg=esmf_logerr_passthru, &
1022 & file=myfile))
THEN
1025 is=index(timenextstring(i),
'T')
1026 IF (is.gt.0) timenextstring(i)(is:is)=
' '
1028 CALL esmf_timeintervalget (
timestep(i), &
1029 & s_r8=time_step(i), &
1031 IF (esmf_logfounderror(rctocheck=rc, &
1032 & msg=esmf_logerr_passthru, &
1034 & file=myfile))
THEN
1038 CALL esmf_timeintervalget (runduration(i), &
1039 & s_r8=time_dura(i), &
1041 IF (esmf_logfounderror(rctocheck=rc, &
1042 & msg=esmf_logerr_passthru, &
1044 & file=myfile))
THEN
1050 IF ((
debuglevel.gt.0).and.(localpet.eq.0))
THEN
1052 &
' Clock Name: ', trim(clockname(i))//
' in '//source,&
1053 &
' Start Time: ', trim(timestartstring(i)), &
1054 & timestart(i)*scale, &
1055 &
' Stop Time: ', trim(timestopstring(i)), &
1056 & timestop(i)*scale, &
1057 &
' Prev Time: ', trim(timeprevstring(i)), &
1058 & timeprev(i)*scale, &
1059 &
' Current Time: ', trim(timecurrstring(i)), &
1060 & timecurr(i)*scale, &
1061 &
' Next Time: ', trim(timenextstring(i)), &
1062 & timenext(i)*scale, &
1063 &
' Time Interval: ', time_step(i), time_step(i)*scale, &
1064 &
' Run Duration: ', time_dura(i), time_dura(i)*scale, &
1065 &
' Stepping Count: ', runtimestepcount(i), &
1066 &
' Advance Count: ', advancecount(i), &
1067 &
'Current Direction: ', trim(directionstring(i)), &
1068 &
' Alarm Count: ', alarmcount(i)
1076 10
FORMAT(/,4x,a,a,/,5(4x,a,a,2x,f15.8,/),2(4x,a,f19.8,2x,f15.8,/), &
1077 & 4x,a,f19.8,/,4x,a,2x,i8,/,4x,a,a,/,4x,a,2x,i8,/)
1416 integer,
intent(out) :: rc
1418 TYPE (esmf_vm) :: vm
1422 logical :: doit, first
1423 logical :: lwrite, masterpet
1424 logical :: lvalue(1)
1425 logical,
allocatable :: lvaluea(:), lvaluei(:)
1426 logical,
allocatable :: lvaluer(:), lvaluew(:)
1428 integer :: icomp, jcomp, myerror, mysize,
nfields, npts, nval
1429 integer :: esmcount, igrids, jgrids, ncplsets, ngrd, nstates
1430 integer :: explstr, implstr, setlstr, lstr
1431 integer :: i, ic, ie, ig, is, j, jg, k, inp, ng, out, status
1432 integer :: ifile, igrid, io_err
1433 integer :: maxd2a_files, maxd2i_files, maxd2r_files, maxd2w_files
1434 integer :: localpet, petcount, mycomm, npets
1435 integer :: cdim, rdim, timefrac
1436 integer :: ivalue(1), nd2a(1), nd2i(1), nd2r(1), nd2w(1)
1437 integer :: newdate(7)
1439 integer :: location(1)
1441 integer,
allocatable :: ivaluea(:)
1442 integer,
allocatable :: ivaluei(:)
1443 integer,
allocatable :: ivaluer(:)
1444 integer,
allocatable :: ivaluew(:)
1446 integer,
allocatable :: ncount(:,:)
1448 real(r8) :: rvalue(1)
1450 real(dp),
dimension(nRval) :: rval
1452 character (len= 1),
parameter :: blank =
' '
1453 character (len= 5) :: pstr, pend
1454 character (len= 20) :: datecalendar
1455 character (len= 20) :: timereferencestring
1456 character (len= 20) :: timerestartstring
1457 character (len= 20) :: timestartstring
1458 character (len= 20) :: timestopstring
1459 character (len= 40) :: frmt
1460 character (len= 40) :: keyword
1461 character (len= 50) :: mylabel, label
1462 character (len= 80) :: string
1463 character (len=256) :: fname, io_errmsg, line
1464 character (len=256) :: atmname, icename, ocnname, wavname
1465 character (len=256),
dimension(nCval) :: cval
1467 character (len=*),
parameter :: myfile = &
1468 & __FILE__//
", read_ESMconfig"
1470 character (len= 6),
allocatable :: setlabel(:)
1471 character (len= 13),
allocatable :: explabel(:), implabel(:)
1472 character (len= 22),
dimension(2) :: fcode
1474 TYPE (esmf_calkind_flag) :: caltype
1475 TYPE (esmf_time) :: mystarttime, myrestarttime
1477 TYPE(
t_io),
allocatable :: d2r(:,:)
1478 TYPE(
t_io),
allocatable :: d2a(:,:)
1479 TYPE(
t_io),
allocatable :: d2i(:,:)
1480 TYPE(
t_io),
allocatable :: d2w(:,:)
1494 CALL esmf_vmget (vm, &
1495 & localpet=localpet, &
1496 & petcount=petcount, &
1497 & mpicommunicator=mycomm, &
1499 IF (esmf_logfounderror(rctocheck=rc, &
1500 & msg=esmf_logerr_passthru, &
1502 & file=myfile))
THEN
1505 masterpet=localpet.eq.0
1551 IF (localpet.eq.0)
THEN
1557 OPEN (inp, file=trim(
cinpname), form=
'formatted', status=
'old', &
1558 & iostat=io_err, iomsg=io_errmsg)
1559 IF (io_err.ne.0)
THEN
1560 IF (localpet.eq.0)
WRITE (out,10) trim(io_errmsg)
1562 rc=esmf_rc_file_open
1564 10
FORMAT (/,
' read_ESMconfig - Unable to open coupling input', &
1565 &
' script.',/,19x,
'ERROR: ',a,/, &
1566 & /,19x,
'In distributed-memory applications, the input', &
1567 & /,19x,
'script file is processed in parallel. The Unix', &
1568 & /,19x,
'routine GETARG is used to get script filename.', &
1569 & /,19x,
'For example, in MPI applications make sure that',&
1570 & /,19x,
'command line is something like:',/, &
1571 & /,19x,
'mpirun -np 4 romsM coupling_esmf.in',/, &
1572 & /,19x,
'and not',/, &
1573 & /,19x,
'mpirun -np 4 romsM < coupling_esmf.in',/)
1594 READ (inp,
'(a)',
err=20,
END=30) line
1595 status=decode_line(line, keyword, nval, cval, rval)
1596 IF (status.gt.0)
THEN
1597 SELECT CASE (trim(keyword))
1599 cplname=trim(adjustl(cval(nval)))
1602 CASE (
'INPname(roms)')
1603 ocnname=trim(adjustl(cval(nval)))
1605 IF (exit_flag.ne.noerror)
THEN
1606 rc=esmf_rc_file_read
1609 IF (.not.
allocated(lvaluer))
THEN
1613 IF (.not.
allocated(ivaluer))
THEN
1617 CASE (
'INPname(atmos)')
1618 atmname=trim(adjustl(cval(nval)))
1620 IF (exit_flag.ne.noerror)
THEN
1621 rc=esmf_rc_file_read
1624 IF (.not.
allocated(lvaluea))
THEN
1628 IF (.not.
allocated(ivaluea))
THEN
1632 CASE (
'INPname(seaice)')
1633 icename=trim(adjustl(cval(nval)))
1634 IF (.not.
allocated(lvaluei))
THEN
1638 IF (.not.
allocated(ivaluei))
THEN
1642 CASE (
'INPname(waves)')
1643 wavname=trim(adjustl(cval(nval)))
1644 IF (.not.
allocated(lvaluew))
THEN
1648 IF (.not.
allocated(ivaluew))
THEN
1652 CASE (
'IsActive(roms)')
1653 npts=load_l(nval, cval, 1, lvalue)
1656 iname=trim(adjustl(ocnname))
1661 IF (.not.
allocated(
models(
iroms)%ExportState))
THEN
1664 IF (.not.
allocated(
models(
iroms)%ImportState))
THEN
1683 CALL mpi_comm_rank (ocn_comm_world, myrank, myerror)
1684 CALL mpi_comm_size (ocn_comm_world, mysize, myerror)
1685 CALL allocate_parallel (
ngridsr)
1686 CALL initialize_parallel
1687 CASE (
'IsActive(atmos)')
1688 npts=load_l(nval, cval, 1, lvalue)
1709 CASE (
'IsActive(seaice)')
1710 npts=load_l(nval, cval, 1, lvalue)
1731 CASE (
'IsActive(waves)')
1732 npts=load_l(nval, cval, 1, lvalue)
1737 IF (.not.
allocated(
models(
iwave)%ExportState))
THEN
1740 IF (.not.
allocated(
models(
iwave)%ImportState))
THEN
1753 CASE (
'IsActive(data)')
1754# ifdef DATA_COUPLING
1755 npts=load_l(nval, cval, 1, lvalue)
1765 CASE (
'Coupled(ATM2OCN)')
1766 npts=load_l(nval, cval,
ngridsr, lvaluer)
1772 IF (any(lvaluer))
THEN
1776 CASE (
'Coupled(ICE2OCN)')
1777 npts=load_l(nval, cval,
ngridsr, lvaluer)
1783 IF (any(lvaluer))
THEN
1787 CASE (
'Coupled(WAV2OCN)')
1788 npts=load_l(nval, cval,
ngridsr, lvaluer)
1794 IF (any(lvaluer))
THEN
1798 CASE (
'Coupled(DAT2OCN)')
1799 npts=load_l(nval, cval,
ngridsr, lvaluer)
1805 IF (any(lvaluer))
THEN
1809 CASE (
'Coupled(OCN2ATM)')
1810 npts=load_l(nval, cval,
ngridsa, lvaluea)
1816 IF (any(lvaluea))
THEN
1820 CASE (
'Coupled(ICE2ATM)')
1821 npts=load_l(nval, cval,
ngridsa, lvaluea)
1827 IF (any(lvaluea))
THEN
1831 CASE (
'Coupled(WAV2ATM)')
1832 npts=load_l(nval, cval,
ngridsa, lvaluea)
1838 IF (any(lvaluea))
THEN
1842 CASE (
'Coupled(DAT2ATM)')
1843 npts=load_l(nval, cval,
ngridsa, lvaluea)
1849 IF (any(lvaluea))
THEN
1853 CASE (
'Coupled(ATM2ICE)')
1854 npts=load_l(nval, cval,
ngridsi, lvaluei)
1860 IF (any(lvaluei))
THEN
1864 CASE (
'Coupled(OCN2ICE)')
1865 npts=load_l(nval, cval,
ngridsi, lvaluei)
1871 IF (any(lvaluei))
THEN
1875 CASE (
'Coupled(WAV2ICE)')
1876 npts=load_l(nval, cval,
ngridsi, lvaluei)
1882 IF (any(lvaluei))
THEN
1886 CASE (
'Coupled(DAT2ICE)')
1887 npts=load_l(nval, cval,
ngridsi, lvaluei)
1893 IF (any(lvaluei))
THEN
1897 CASE (
'Coupled(ATM2WAV)')
1898 npts=load_l(nval, cval,
ngridsw, lvaluew)
1904 IF (any(lvaluew))
THEN
1908 CASE (
'Coupled(ICE2WAV)')
1909 npts=load_l(nval, cval,
ngridsw, lvaluew)
1915 IF (any(lvaluew))
THEN
1919 CASE (
'Coupled(OCN2WAV)')
1920 npts=load_l(nval, cval,
ngridsw, lvaluew)
1926 IF (any(lvaluew))
THEN
1930 CASE (
'Coupled(DAT2WAV)')
1931 npts=load_l(nval, cval,
ngridsw, lvaluew)
1937 IF (any(lvaluew))
THEN
1941 CASE (
'CouplingType')
1942 npts=load_i(nval, rval, 1, ivalue)
1944 CASE (
'PETlayoutOption')
1945 npts=load_i(nval, rval, 1, ivalue)
1946 IF (ivalue(1).eq.0)
THEN
1948 ELSE IF (ivalue(1).eq.1)
THEN
1952 npts=load_i(nval, rval, 1, ivalue)
1955 npts=load_i(nval, rval, 1, ivalue)
1966 CASE (
'Nthreads(roms)')
1967 npts=load_i(nval, rval, 1, ivalue)
1977 CASE (
'Nthreads(atmos)')
1978 npts=load_i(nval, rval, 1, ivalue)
1988 CASE (
'Nthreads(seaice)')
1989 npts=load_i(nval, rval, 1, ivalue)
1999 CASE (
'Nthreads(waves)')
2000 npts=load_i(nval, rval, 1, ivalue)
2010 CASE (
'ReferenceTime')
2014 CASE (
'RestartTime')
2017 npts=load_i(nval, rval, 6,
stopdate)
2019 npts=load_i(nval, rval, 6,
timestep)
2021 datecalendar=trim(adjustl(cval(nval)))
2023 clockinfo(i)%CalendarString=trim(datecalendar)
2025 CASE (
'TimeFrac(ATM2OCN)')
2026 npts=load_i(nval, rval,
ngridsr, ivaluer)
2033 CASE (
'TimeFrac(ICE2OCN)')
2034 npts=load_i(nval, rval,
ngridsr, ivaluer)
2041 CASE (
'TimeFrac(WAV2OCN)')
2042 npts=load_i(nval, rval,
ngridsr, ivaluer)
2049 CASE (
'TimeFrac(DAT2OCN)')
2050 npts=load_i(nval, rval,
ngridsr, ivaluer)
2057 CASE (
'TimeFrac(OCN2ATM)')
2058 npts=load_i(nval, rval,
ngridsa, ivaluea)
2065 CASE (
'TimeFrac(ICE2ATM)')
2066 npts=load_i(nval, rval,
ngridsa, ivaluea)
2073 CASE (
'TimeFrac(WAV2ATM)')
2074 npts=load_i(nval, rval,
ngridsa, ivaluea)
2081 CASE (
'TimeFrac(DAT2ATM)')
2082 npts=load_i(nval, rval,
ngridsa, ivaluea)
2089 CASE (
'TimeFrac(ATM2ICE)')
2090 npts=load_i(nval, rval,
ngridsi, ivaluei)
2097 CASE (
'TimeFrac(OCN2ICE)')
2098 npts=load_i(nval, rval,
ngridsi, ivaluei)
2105 CASE (
'TimeFrac(WAV2ICE)')
2106 npts=load_i(nval, rval,
ngridsi, ivaluei)
2113 CASE (
'TimeFrac(DAT2ICE)')
2114 npts=load_i(nval, rval,
ngridsi, ivaluei)
2121 CASE (
'TimeFrac(ATM2WAV)')
2122 npts=load_i(nval, rval,
ngridsw, ivaluew)
2129 CASE (
'TimeFrac(ICE2WAV)')
2130 npts=load_i(nval, rval,
ngridsw, ivaluew)
2137 CASE (
'TimeFrac(OCN2WAV)')
2138 npts=load_i(nval, rval,
ngridsw, ivaluew)
2145 CASE (
'TimeFrac(DAT2WAV)')
2146 npts=load_i(nval, rval,
ngridsw, ivaluew)
2153 CASE (
'extrapNumLevels')
2154 npts=load_i(nval, rval, 1, ivalue)
2156# ifdef DATA_COUPLING
2157 CASE (
'WeightsFile(atmos)')
2162 CASE (
'VnameDATA(atmos)')
2167 CASE (
'VnameESM(atmos)')
2172 CASE (
'NestedGrid(atmos)')
2173 npts=load_i(nval, rval, 1, ivalue)
2180 npts=load_i(nval, rval, 1, ivalue)
2183 npts=load_i(nval, rval, 1, ivalue)
2188 CASE (
'Nimport(roms)')
2189 npts=load_i(nval, rval, 1, ivalue)
2190 IF (ivalue(1).gt.0)
THEN
2191 IF (.not.
allocated(
models(
iroms)%ImportField))
THEN
2196 CASE (
'Nexport(roms)')
2197 npts=load_i(nval, rval, 1, ivalue)
2198 IF (ivalue(1).gt.0)
THEN
2199 IF (.not.
allocated(
models(
iroms)%ExportField))
THEN
2204 CASE (
'Import(roms)')
2208 & trim(adjustl(cval(nval)))
2210 CASE (
'Export(roms)')
2214 & trim(adjustl(cval(nval)))
2216 CASE (
'Nimport(atmos)')
2217 npts=load_i(nval, rval, 1, ivalue)
2218 IF (ivalue(1).gt.0)
THEN
2226 CASE (
'Nexport(atmos)')
2227 npts=load_i(nval, rval, 1, ivalue)
2228 IF (ivalue(1).gt.0)
THEN
2236 CASE (
'Import(atmos)')
2241 & trim(adjustl(cval(nval)))
2244 CASE (
'Export(atmos)')
2249 & trim(adjustl(cval(nval)))
2252 CASE (
'Nimport(seaice)')
2253 npts=load_i(nval, rval, 1, ivalue)
2254 IF (ivalue(1).gt.0)
THEN
2262 CASE (
'Nexport(seaice)')
2263 npts=load_i(nval, rval, 1, ivalue)
2264 IF (ivalue(1).gt.0)
THEN
2272 CASE (
'Import(seaice)')
2277 & trim(adjustl(cval(nval)))
2280 CASE (
'Export(seaice)')
2285 & trim(adjustl(cval(nval)))
2288 CASE (
'Nimport(waves)')
2289 npts=load_i(nval, rval, 1, ivalue)
2290 IF (ivalue(1).gt.0)
THEN
2292 IF (.not.
allocated(
models(
iwave)%ImportField))
THEN
2298 CASE (
'Nexport(waves)')
2299 npts=load_i(nval, rval, 1, ivalue)
2300 IF (ivalue(1).gt.0)
THEN
2302 IF (.not.
allocated(
models(
iwave)%ExportField))
THEN
2308 CASE (
'Import(waves)')
2313 & trim(adjustl(cval(nval)))
2316 CASE (
'Export(waves)')
2321 & trim(adjustl(cval(nval)))
2325# ifdef DATA_COUPLING
2326 CASE (
'nDataExport(roms)')
2327 npts=load_i(nval, rval, 1, ivalue)
2330 &
models(icomp)%IsActive)
THEN
2331 dataset(icomp)%Nfields=ivalue(1)
2332 IF (
dataset(icomp)%Nfields.gt.0)
THEN
2334 IF (.not.
allocated(
dataset(icomp)%Export))
THEN
2335 allocate (
dataset(icomp)%Export(ivalue(1)) )
2337 IF (.not.
allocated(
dataset(icomp)%Field))
THEN
2338 allocate (
dataset(icomp)%Field(ivalue(1)) )
2340 IF (.not.
allocated(
dataset(icomp)%Ctarget))
THEN
2341 allocate (
dataset(icomp)%Ctarget(ivalue(1)) )
2348 CASE (
'nDataFiles(roms)')
2349 npts=load_i(nval, rval, 1, nd2r)
2352 &
models(icomp)%IsActive)
THEN
2354 IF (
dataset(icomp)%Nfiles.gt.0)
THEN
2355 IF (.not.
allocated(
dataset(icomp)%IFS))
THEN
2356 allocate(
dataset(icomp)%IFS(nd2r(1)) )
2360 IF (
dataset(icomp)%Nfiles.gt.0)
THEN
2361 IF (
allocated(ncount))
THEN
2362 deallocate ( ncount )
2364 allocate ( ncount(nd2r(1),1) )
2366 IF (.not.
allocated(d2r))
THEN
2367 allocate ( d2r(nd2r(1),1) )
2370 CASE (
'DataExport(roms)')
2378 CASE (
'DataFiles(roms)')
2381 label=
'D2R - Data Model export fields to ROMS'
2382 npts=load_s2d(nval, cval, cdim, line, label, ifile, &
2383 & igrid, 1, nd2r, ncount, nd2r(1), inp_lib, &
2386 CASE (
'nDataExport(atmos)')
2387 npts=load_i(nval, rval, 1, ivalue)
2390 &
models(icomp)%IsActive)
THEN
2391 dataset(icomp)%Nfields=ivalue(1)
2392 IF (
dataset(icomp)%Nfields.gt.0)
THEN
2394 IF (.not.
allocated(
dataset(icomp)%Field))
THEN
2395 allocate (
dataset(icomp)%Field(ivalue(1)) )
2397 IF (.not.
allocated(
dataset(icomp)%Export))
THEN
2398 allocate (
dataset(icomp)%Export(ivalue(1)) )
2400 IF (.not.
allocated(
dataset(icomp)%Ctarget))
THEN
2401 allocate (
dataset(icomp)%Ctarget(ivalue(1)) )
2408 CASE (
'nDataFiles(atmos)')
2409 npts=load_i(nval, rval, 1, nd2a)
2412 &
models(icomp)%IsActive)
THEN
2414 IF (
dataset(icomp)%Nfiles.gt.0)
THEN
2415 IF (.not.
allocated(
dataset(icomp)%IFS))
THEN
2416 allocate (
dataset(icomp)%IFS(nd2a(1)) )
2420 IF (
dataset(icomp)%Nfiles.gt.0)
THEN
2421 IF (
allocated(ncount))
THEN
2422 deallocate ( ncount )
2424 allocate ( ncount(nd2a(1),1) )
2426 IF (.not.
allocated(d2a))
THEN
2427 allocate ( d2a(nd2a(1),1) )
2430 CASE (
'DataExport(atmos)')
2438 CASE (
'DataFiles(atmos)')
2441 label=
'D2A - Data Model export fields to ATM model'
2442 npts=load_s2d(nval, cval, cdim, line, label, ifile, &
2443 & igrid, 1, nd2a, ncount, nd2a(1), inp_lib, &
2446 CASE (
'nDataExport(seaice)')
2447 npts=load_i(nval, rval, 1, ivalue)
2450 &
models(icomp)%IsActive)
THEN
2451 dataset(icomp)%Nfields=ivalue(1)
2452 IF (
dataset(icomp)%Nfields.gt.0)
THEN
2454 IF (.not.
allocated(
dataset(icomp)%Field))
THEN
2455 allocate (
dataset(icomp)%Field(ivalue(1)) )
2457 IF (.not.
allocated(
dataset(icomp)%Export))
THEN
2458 allocate (
dataset(icomp)%Export(ivalue(1)) )
2460 IF (.not.
allocated(
dataset(icomp)%Ctarget))
THEN
2461 allocate (
dataset(icomp)%Ctarget(ivalue(1)) )
2468 CASE (
'nDataFiles(seaice)')
2469 npts=load_i(nval, rval, 1, nd2i)
2472 &
models(icomp)%IsActive)
THEN
2474 IF (
dataset(icomp)%Nfiles.gt.0)
THEN
2475 IF (.not.
allocated(
dataset(icomp)%IFS))
THEN
2476 allocate(
dataset(icomp)%IFS(nd2i(1)) )
2480 IF (
dataset(icomp)%Nfiles.gt.0)
THEN
2481 IF (
allocated(ncount))
THEN
2482 deallocate ( ncount )
2484 allocate ( ncount(nd2i(1),1) )
2486 IF (.not.
allocated(d2i))
THEN
2487 allocate ( d2i(nd2i(1),1) )
2490 CASE (
'DataExport(seaice)')
2498 CASE (
'DataFiles(seaice)')
2501 label=
'D2I - Data Model export fields to Sea ICE model'
2502 npts=load_s2d(nval, cval, cdim, line, label, ifile, &
2503 & igrid, 1, nd2i, ncount, nd2i(1), inp_lib, &
2506 CASE (
'nDataExport(waves)')
2507 npts=load_i(nval, rval, 1, ivalue)
2510 &
models(icomp)%IsActive)
THEN
2511 dataset(icomp)%Nfields=ivalue(1)
2512 IF (
dataset(icomp)%Nfields.gt.0)
THEN
2514 IF (.not.
allocated(
dataset(icomp)%Field))
THEN
2515 allocate (
dataset(icomp)%Field(ivalue(1)) )
2517 IF (.not.
allocated(
dataset(icomp)%Export))
THEN
2518 allocate (
dataset(icomp)%Export(ivalue(1)) )
2520 IF (.not.
allocated(
dataset(icomp)%Ctarget))
THEN
2521 allocate (
dataset(icomp)%Ctarget(ivalue(1)) )
2528 CASE (
'nDataFiles(waves)')
2529 npts=load_i(nval, rval, 1, nd2w)
2532 &
models(icomp)%IsActive)
THEN
2534 IF (
dataset(icomp)%Nfiles.gt.0)
THEN
2535 IF (.not.
allocated(
dataset(icomp)%IFS))
THEN
2536 allocate(
dataset(icomp)%IFS(nd2w(1)) )
2540 IF (
dataset(icomp)%Nfiles.gt.0)
THEN
2541 IF (
allocated(ncount))
THEN
2542 deallocate ( ncount )
2544 allocate ( ncount(nd2w(1),1) )
2546 IF (.not.
allocated(d2w))
THEN
2547 allocate ( d2w(nd2w(1),1) )
2550 CASE (
'DataExport(waves)')
2558 CASE (
'DataFiles(waves)')
2561 label=
'D2W - Data Model export fields to Wave model'
2562 npts=load_s2d(nval, cval, cdim, line, label, ifile, &
2563 & igrid, 1, nd2w, ncount, nd2w(1), inp_lib, &
2570 20
IF (localpet.eq.0)
WRITE (out,40) line
2572 rc=esmf_rc_file_read
2575 40
FORMAT (/,
' read_ESMconfig - Error while processing line: ',/,a)
2591 IF (i.ne.
idata)
THEN
2597 nstates=max(nstates,ic)
2605 IF (i.ne.
idata)
THEN
2615 IF (.not.
allocated(
coupled(
idata)%DataCoupledSets))
THEN
2628 IF (
models(i)%IsActive)
THEN
2629 IF (i.eq.
idata)
THEN
2634 IF (.not.
allocated(
models(i)%grid))
THEN
2635 allocate (
models(i)%grid(ngrd) )
2637 IF (.not.
allocated(
coupled(i)%SetLabel))
THEN
2638 allocate (
coupled(i)%SetLabel(ngrd) )
2643 IF (.not.
allocated(
coupled(i)%ExpLabel))
THEN
2644 allocate (
coupled(i)%ExpLabel(ngrd) )
2649 IF (.not.
allocated(
coupled(i)%ImpLabel))
THEN
2650 allocate (
coupled(i)%ImpLabel(ngrd) )
2663 ncplsets=maxval(
models(:)%Ngrids, mask=
models(:)%IsActive)
2664 IF ((ncplsets.eq.1).and.(nstates.eq.1))
THEN
2668 IF (
models(i)%IsActive)
THEN
2669 j=count(
coupled(i)%LinkedGrid)
2677 location=maxloc(
models(:)%Ngrids, mask=
models(:)%IsActive)
2687 esmorder(ic)=location(1)
2689 IF (
models(i)%IsActive.and.(i.ne.location(1)))
THEN
2698 IF (.not.
allocated(setlabel))
THEN
2699 allocate ( setlabel(ncplsets) )
2701 IF (.not.
allocated(explabel))
THEN
2702 allocate ( explabel(ncplsets) )
2704 IF (.not.
allocated(implabel))
THEN
2705 allocate ( implabel(ncplsets) )
2708 WRITE (setlabel(i),
'(a,i2.2)')
'ESM_', i
2709 WRITE (explabel(i),
'(a,i2.2)')
'Export_ESM_', i
2710 WRITE (implabel(i),
'(a,i2.2)')
'Import_ESM_', i
2717 IF (jcomp.eq.
idata)
THEN
2720 jgrids=
models(jcomp)%Ngrids
2724 IF (icomp.eq.
idata)
THEN
2727 igrids=
models(icomp)%Ngrids
2729 IF (icomp.ne.jcomp)
THEN
2732 IF (
coupled(icomp)%LinkedGrid(ig,jcomp).or. &
2733 &
coupled(jcomp)%LinkedGrid(jg,icomp))
THEN
2735 setlstr=len_trim(
coupled(jcomp)%SetLabel(jg))
2736 IF (setlstr.eq.0)
THEN
2737 coupled(jcomp)%SetLabel(jg)=trim(setlabel(ng))
2740 explstr=len_trim(
coupled(jcomp)%ExpLabel(jg))
2742 IF (explstr.eq.0)
THEN
2743 coupled(jcomp)%ExpLabel(jg)=trim(explabel(ng))
2746 IF (explstr.eq.0)
THEN
2747 coupled(jcomp)%ExpLabel(jg)=
'NONE'
2751 implstr=len_trim(
coupled(jcomp)%ImpLabel(jg))
2753 IF (implstr.eq.0)
THEN
2754 coupled(jcomp)%ImpLabel(jg)=trim(implabel(ng))
2757 IF (implstr.eq.0)
THEN
2758 coupled(jcomp)%ImpLabel(jg)=
'NONE'
2779 SELECT CASE (trim(lowercase(datecalendar)))
2781 caltype=esmf_calkind_gregorian
2782 CASE (
'year_360_day',
'360_day')
2783 caltype=esmf_calkind_360day
2787 IF (esmf_logfounderror(rctocheck=rc, &
2788 & msg=esmf_logerr_passthru, &
2790 & file=myfile))
THEN
2814 & calkindflag=caltype, &
2816 IF (esmf_logfounderror(rctocheck=rc, &
2817 & msg=esmf_logerr_passthru, &
2819 & file=myfile))
THEN
2825 & timestring=timereferencestring)
2826 IF (esmf_logfounderror(rctocheck=rc, &
2827 & msg=esmf_logerr_passthru, &
2829 & file=myfile))
THEN
2832 is=index(timereferencestring,
'T')
2833 IF (is.gt.0) timereferencestring(is:is)=
' '
2839 clockinfo(i)%Time_ReferenceString=trim(timereferencestring)
2853 IF (esmf_logfounderror(rctocheck=rc, &
2854 & msg=esmf_logerr_passthru, &
2856 & file=myfile))
THEN
2862 IF (esmf_logfounderror(rctocheck=rc, &
2863 & msg=esmf_logerr_passthru, &
2865 & file=myfile))
THEN
2876 CALL esmf_timeset (mystarttime, &
2883 & calkindflag=caltype, &
2885 IF (esmf_logfounderror(rctocheck=rc, &
2886 & msg=esmf_logerr_passthru, &
2888 & file=myfile))
THEN
2892# ifdef REGRESS_STARTCLOCK
2911 & timestring=timestartstring, &
2913 IF (esmf_logfounderror(rctocheck=rc, &
2914 & msg=esmf_logerr_passthru, &
2916 & file=myfile))
THEN
2928 & calkindflag=caltype, &
2930 IF (esmf_logfounderror(rctocheck=rc, &
2931 & msg=esmf_logerr_passthru, &
2933 & file=myfile))
THEN
2942 & timestring=timestartstring)
2943 IF (esmf_logfounderror(rctocheck=rc, &
2944 & msg=esmf_logerr_passthru, &
2946 & file=myfile))
THEN
2949 is=index(timestartstring,
'T')
2950 IF (is.gt.0) timestartstring(is:is)=
' '
2956 clockinfo(i)%Time_StartString=trim(timestartstring)
2961 CALL esmf_timeset (myrestarttime, &
2968 & calkindflag=caltype, &
2970 IF (esmf_logfounderror(rctocheck=rc, &
2971 & msg=esmf_logerr_passthru, &
2973 & file=myfile))
THEN
2977# ifdef REGRESS_STARTCLOCK
2990 & timestring=timerestartstring, &
2992 IF (esmf_logfounderror(rctocheck=rc, &
2993 & msg=esmf_logerr_passthru, &
2995 & file=myfile))
THEN
3007 & calkindflag=caltype, &
3009 IF (esmf_logfounderror(rctocheck=rc, &
3010 & msg=esmf_logerr_passthru, &
3012 & file=myfile))
THEN
3021 & timestring=timerestartstring)
3022 IF (esmf_logfounderror(rctocheck=rc, &
3023 & msg=esmf_logerr_passthru, &
3025 & file=myfile))
THEN
3028 is=index(timerestartstring,
'T')
3029 IF (is.gt.0) timerestartstring(is:is)=
' '
3035 clockinfo(i)%Time_RestartString=trim(timerestartstring)
3047 & calkindflag=caltype, &
3049 IF (esmf_logfounderror(rctocheck=rc, &
3050 & msg=esmf_logerr_passthru, &
3052 & file=myfile))
THEN
3058 & timestring=timestopstring)
3059 IF (esmf_logfounderror(rctocheck=rc, &
3060 & msg=esmf_logerr_passthru, &
3062 & file=myfile))
THEN
3065 is=index(timestopstring,
'T')
3066 IF (is.gt.0) timestopstring(is:is)=
' '
3072 clockinfo(i)%Time_StopString=trim(timestopstring)
3082# ifdef DATA_COUPLING
3123 IF (.not.
allocated(
models(
idata)%ExportField))
THEN
3149 IF (
models(j)%IsActive)
THEN
3159 IF (
models(j)%IsActive)
THEN
3183 IF (.not.
allocated(
connectors(i,j)%PETlist))
THEN
3192 IF (.not.
allocated(
connectors(i,j)%PETlist))
THEN
3213 lstr=index(my_fflags,
'free')-2
3214 IF (lstr.le.0) lstr=len_trim(my_fflags)
3215 WRITE (out,70) trim(esmf_version_string), &
3222 & my_fflags(1:lstr), &
3224 WRITE (out,80)
' Coupling Input Parameters Filename = ', &
3226 WRITE (out,80)
' Coupling Run Sequence Filename = ', &
3228 WRITE (out,80)
' Coupling Input Metadata Filename = ', &
3230 WRITE (out,80)
' ROMS Input Parameters Filename = ', &
3234 WRITE (out,80)
' ATM Model Input Parameters Filename = ', &
3238 WRITE (out,80)
' SEAICE Model Input Parameters Filename = ', &
3242 WRITE (out,80)
' WAVE Model Input Parameters Filename = ', &
3246 WRITE (out,
'(a)') char(10)
3251 &
' component with nested grids is coupled.'
3253 string=trim(
models(
iroms)%name)//
' component is coupled.'
3256 string=trim(
models(
iroms)%name)//
' component is not coupled.'
3258 WRITE (out,100)
models(
iroms)%IsActive,
'IsActive(roms)', &
3264 &
' components with nested grids is coupled.'
3266 string=trim(
models(
iatmos)%name)//
' component is coupled.'
3269 string=trim(
models(
iatmos)%name)//
' component is not coupled.'
3271 WRITE (out,100)
models(
iatmos)%IsActive,
'IsActive(atmos)', &
3275 string=trim(
models(
idata)%name)//
' component is coupled.'
3277 string=trim(
models(
idata)%name)//
' component is not coupled.'
3279 WRITE (out,100)
models(
idata)%IsActive,
'IsActive(data)', &
3285 &
' components with nested grids is coupled.'
3290 string=trim(
models(
iseaice)%name)//
' component is not coupled.'
3292 WRITE (out,100)
models(
iseaice)%IsActive,
'IsActive(seaice)', &
3298 &
' components with nested grids is coupled.'
3300 string=trim(
models(
iwave)%name)//
' component is coupled.'
3303 string=trim(
models(
iwave)%name)//
' component is not coupled.'
3305 WRITE (out,100)
models(
iseaice)%IsActive,
'IsActive(waves)', &
3321 IF (
coupled(j)%LinkedGrid(ng,i).and.(i.ne.j))
THEN
3322 WRITE (out,110)
coupled(j)%LinkedGrid(ng,i), &
3324 & trim(
clabel(i))//
'2'// &
3325 & trim(
clabel(j))//
')', &
3326 & trim(
models(i)%name), &
3327 & trim(
models(j)%name), ng
3339 string=
'Explicit coupling method.'
3341 string=
'Semi-Implicit coupling method.'
3344 rc=esmf_rc_val_wrong
3348 WRITE (out,120)
couplingtype,
'CouplingType', trim(string)
3357 string=
'Sequential, models run on all PETs.'
3359 string=
'Concurrent, each model runs on a subset of PETs.'
3362 rc=esmf_rc_val_wrong
3371 WRITE (out,120)
itiled,
'ItileD', &
3372 &
'DATA model tile partition in the I-direction.'
3373 WRITE (out,120)
jtiled,
'JtileD', &
3374 &
'DATA model tile partition in the J-direction.'
3385 npets=
models(icomp)%nPETs
3386 IF (npets.eq.petcount)
THEN
3387 WRITE (out,150) npets,
'Nthreads(roms)', &
3388 &
'Assigned number of PETs for '// &
3389 & trim(
models(icomp)%name)//
'.'
3390 WRITE (pstr,
'(i5)')
models(icomp)%PETlist(1)
3391 WRITE (pend,
'(i5)')
models(icomp)%PETlist(npets)
3392 IF (npets.gt.1)
THEN
3393 WRITE (out,290) trim(adjustl(pstr))//
' to '// &
3394 & trim(adjustl(pend))
3396 WRITE (out,290) trim(adjustl(pstr))
3399 WRITE (out,220)
'Nthreads(roms)', ng, npets, &
3401 rc=esmf_rc_val_wrong
3408 npets=
models(icomp)%nPETs
3409 IF (npets.eq.petcount)
THEN
3410 WRITE (out,150) npets,
'Nthreads(atmos)', &
3411 &
'Assigned number of PETs for '// &
3412 & trim(
models(icomp)%name)//
'.'
3413 WRITE (pstr,
'(i5)')
models(icomp)%PETlist(1)
3414 WRITE (pend,
'(i5)')
models(icomp)%PETlist(npets)
3415 IF (npets.gt.1)
THEN
3416 WRITE (out,290) trim(adjustl(pstr))//
' to '// &
3417 & trim(adjustl(pend))
3419 WRITE (out,290) trim(adjustl(pstr))
3422 WRITE (out,230)
'Nthreads(atmos)', npets, petcount
3423 rc=esmf_rc_val_wrong
3430 npets=
models(icomp)%nPETs
3431 IF (npets.eq.petcount)
THEN
3432 WRITE (out,150) npets,
'Nthreads(seaice)', &
3433 &
'Assigned number of PETs for '// &
3434 & trim(
models(icomp)%name)//
'.'
3435 WRITE (pstr,
'(i5)')
models(icomp)%PETlist(1)
3436 WRITE (pend,
'(i5)')
models(icomp)%PETlist(npets)
3437 IF (npets.gt.1)
THEN
3438 WRITE (out,290) trim(adjustl(pstr))//
' to '// &
3439 & trim(adjustl(pend))
3441 WRITE (out,290) trim(adjustl(pstr))
3444 WRITE (out,230)
'Nthreads(seaice)', npets, petcount
3445 rc=esmf_rc_val_wrong
3453 IF (npets.eq.petcount)
THEN
3454 WRITE (out,150) npets,
'Nthreads(waves)', &
3455 &
'Assigned number of PETs for '// &
3456 & trim(
models(icomp)%name)//
'.'
3457 WRITE (pstr,
'(i5)')
models(icomp)%PETlist(1)
3458 WRITE (pend,
'(i5)')
models(icomp)%PETlist(npets)
3459 IF (npets.gt.1)
THEN
3460 WRITE (out,290) trim(adjustl(pstr))//
' to '// &
3461 & trim(adjustl(pend))
3463 WRITE (out,290) trim(adjustl(pstr))
3466 WRITE (out,230)
'Nthreads(waves)', npets, petcount
3467 rc=esmf_rc_val_wrong
3474 npets=
models(icomp)%nPETs
3475 IF (npets.eq.petcount)
THEN
3476 WRITE (out,150) npets,
'Nthreads(data)', &
3477 &
'Assigned number of PETs for '// &
3478 & trim(
models(icomp)%name)// &
3479 &
', ItileD * JtileD.'
3480 WRITE (pstr,
'(i5)')
models(icomp)%PETlist(1)
3481 WRITE (pend,
'(i5)')
models(icomp)%PETlist(npets)
3482 IF (npets.gt.1)
THEN
3483 WRITE (out,290) trim(adjustl(pstr))//
' to '// &
3484 & trim(adjustl(pend))
3486 WRITE (out,290) trim(adjustl(pstr))
3489 WRITE (out,230)
'ItileD * JtileD', npets, petcount
3490 rc=esmf_rc_val_wrong
3499 npets=
models(icomp)%nPETs
3500 WRITE (out,150) npets,
'Nthreads(roms)', &
3501 &
'Assigned number of PETs for '// &
3502 & trim(
models(icomp)%name)//
'.'
3503 WRITE (pstr,
'(i5)')
models(icomp)%PETlist(1)
3504 WRITE (pend,
'(i5)')
models(icomp)%PETlist(npets)
3505 IF (npets.gt.1)
THEN
3506 WRITE (out,290) trim(adjustl(pstr))//
' to '// &
3507 & trim(adjustl(pend))
3509 WRITE (out,290) trim(adjustl(pstr))
3514 npets=
models(icomp)%nPETs
3515 WRITE (out,150) npets,
'Nthreads(data)', &
3516 &
'Assigned number of PETs for '// &
3517 & trim(
models(icomp)%name)// &
3518 &
', ItileD * JtileD.'
3519 WRITE (pstr,
'(i5)')
models(icomp)%PETlist(1)
3520 WRITE (pend,
'(i5)')
models(icomp)%PETlist(npets)
3521 IF (npets.gt.1)
THEN
3522 WRITE (out,290) trim(adjustl(pstr))//
' to '// &
3523 & trim(adjustl(pend))
3525 WRITE (out,290) trim(adjustl(pstr))
3530 npets=
models(icomp)%nPETs
3531 WRITE (out,150) npets,
'Nthreads(atmos)', &
3532 &
'Assigned number of PETs for '// &
3533 & trim(
models(icomp)%name)//
'.'
3534 WRITE (pstr,
'(i5)')
models(icomp)%PETlist(1)
3535 WRITE (pend,
'(i5)')
models(icomp)%PETlist(npets)
3536 IF (npets.gt.1)
THEN
3537 WRITE (out,290) trim(adjustl(pstr))//
' to '// &
3538 & trim(adjustl(pend))
3540 WRITE (out,290) trim(adjustl(pstr))
3545 npets=
models(icomp)%nPETs
3546 WRITE (out,150) npets,
'Nthreads(seaice)', &
3547 &
'Assigned number of PETs for '// &
3548 & trim(
models(icomp)%name)//
'.'
3549 WRITE (pstr,
'(i5)')
models(icomp)%PETlist(1)
3550 WRITE (pend,
'(i5)')
models(icomp)%PETlist(npets)
3551 IF (npets.gt.1)
THEN
3552 WRITE (out,290) trim(adjustl(pstr))//
' to '// &
3553 & trim(adjustl(pend))
3555 WRITE (out,290) trim(adjustl(pstr))
3560 npets=
models(icomp)%nPETs
3561 WRITE (out,150) npets,
'Nthreads(waves)', &
3562 &
'Assigned number of PETs for '// &
3563 & trim(
models(icomp)%name)//
'.'
3564 WRITE (pstr,
'(i5)')
models(icomp)%PETlist(1)
3565 WRITE (pend,
'(i5)')
models(icomp)%PETlist(npets)
3566 IF (npets.gt.1)
THEN
3567 WRITE (out,290) trim(adjustl(pstr))//
' to '// &
3568 & trim(adjustl(pend))
3570 WRITE (out,290) trim(adjustl(pstr))
3574 WRITE (out,240)
sumpets, petcount
3575 rc=esmf_rc_val_wrong
3583 IF (npets.eq.petcount)
THEN
3584 WRITE (out,150) npets,
'Nthreads(roms)', &
3585 &
'Assigned number of PETs for ROMS.'
3587 WRITE (out,220)
'Nthreads(roms)', ng, npets, petcount
3588 rc=esmf_rc_val_wrong
3595 SELECT CASE (trim(datecalendar))
3597 WRITE (out,170)
' gregorian',
'Calendar', &
3598 &
'ESM components date calendar.'
3599 CASE (
'year_360_day')
3600 WRITE (out,170)
'year_360_day',
'Calendar', &
3601 &
'ESM components date calendar.'
3603 WRITE (out,250)
'Calendar', trim(datecalendar)
3604 rc=esmf_rc_val_wrong
3609 WRITE (out,160) (
referencedate(i), i=1,6),
'ReferenceTime', &
3610 &
'Coupling driver reference time.'
3611 WRITE (out,160) (
startdate(i), i=1,6),
'StartTime', &
3612 &
'Simulation start time.'
3613 WRITE (out,160) (
restartdate(i), i=1,6),
'RestartTime', &
3614 &
'Simulation re-start time.'
3615 WRITE (out,160) (
stopdate(i), i=1,6),
'StopTime', &
3616 &
'Simulation stop time.'
3621 WRITE (out,160) (
timestep(i), i=1,6),
'TimeStep', &
3622 &
'Driver coupling time interval.'
3624 WRITE (out,160) (
timestep(i), i=1,6),
'TimeStep', &
3625 &
'Simulation elapsed time interval.'
3629 IF (
models(j)%IsActive)
THEN
3630 IF (j.eq.
idata)
THEN
3633 ngrd=
SIZE(
coupled(j)%LinkedGrid,dim=1)
3637 IF (
coupled(j)%LinkedGrid(ng,i).and.(i.ne.j))
THEN
3638 timefrac=
models(j)%TimeFrac(ng,i)
3639 string=
'TimeFrac('// &
3640 & trim(
clabel(i))//
'2'// &
3642 IF (timefrac.gt.0)
THEN
3643 WRITE (out,180) timefrac, trim(string), &
3644 &
'Coupling TimeStep fraction for '// &
3645 & trim(
models(i)%name)//
' -> '// &
3646 & trim(
models(j)%name)//
', grid: ', ng
3648 WRITE (out,210) trim(string), timefrac
3649 rc=esmf_rc_val_wrong
3660 &
'Number of levels for creep fill extrapolation.'
3662# ifdef DATA_COUPLING
3666 WRITE (out,310) 1,
'WeightsFile(atmos)', &
3668 &
' component melding weights coefficients NetCDF file:', &
3671 &
'VnameDATA(atmos)', &
3672 &
'DATA component weights NetCDF variable name.'
3674 &
'VnameESM(atmos)', &
3675 &
'ESM component weights NetCDF variable name.'
3677 &
'NestedGrid(atmos)', &
3678 &
'Grid needing merged fields from DATA-ESM components.'
3684 &
'Coupling debugging level flag.'
3687 rc=esmf_rc_val_wrong
3693 &
'Execution tracing level flag.'
3697 string=lowercase(
cmodel(j))
3699 &
'Nimport('//trim(string)//
')', &
3700 &
'Number of '//trim(
models(j)%name)// &
3701 &
' component import fields:'
3703 WRITE (out,200) i, &
3704 & trim(
models(j)%ImportField(i)%short_name)
3707 &
'Nexport('//trim(string)//
')', &
3708 &
'Number of '//trim(
models(j)%name)// &
3709 &
' component export fields:'
3711 WRITE (out,200) i, &
3712 & trim(
models(j)%ExportField(i)%short_name)
3716 WRITE (out,260)
'ERROR: The '//trim(
models(j)%name)// &
3717 &
' component is not importing or exporting fields.', &
3718 &
'Revise '''//trim(
cinpname)//
''' script for '// &
3719 &
'Nimport('//trim(string)//
') or '// &
3720 &
'Nexport('//trim(string)//
').'
3721 rc=esmf_rc_val_wrong
3729 string=lowercase(
cmodel(j))
3730 IF (j.ne.
idata)
THEN
3733 WRITE (out,270)
dataset(j)%Nfields, &
3734 &
'nDataExport('//trim(string)//
')', &
3735 &
'Number of export DATA model fields to '//&
3736 & trim(
models(j)%name)//
' component:'
3738 WRITE (out,200) i, trim(
dataset(j)%Field(i))
3740 WRITE (out,270)
dataset(j)%Nfiles, &
3741 &
'nDataFiles('//trim(string)//
')', &
3742 &
'Number of source DATA model files for '//&
3743 & trim(
models(j)%name)//
' component:'
3744 keyword=
'DataFiles('//trim(string)//
')'
3746 DO ifile=1,
dataset(j)%IFS(i)%Nfiles
3747 fname=
dataset(j)%IFS(i)%files(ifile)
3748 IF (find_file(ng, out, fname, trim(keyword)))
THEN
3749 IF (ifile.eq.1)
THEN
3750 WRITE (out,280) i,
': ', trim(fname)
3752 WRITE (out,
'(t42,6x,a)') trim(fname)
3755 rc=esmf_rc_not_found
3757 WRITE (out,300) trim(
models(j)%name), ng, &
3766 WRITE (out,340)
'Coupled Import and Export States Name Sets:'
3768 IF (
models(i)%IsActive)
THEN
3769 IF (i.eq.
idata)
THEN
3779 IF (
models(j)%IsActive.and.(j.ne.i))
THEN
3780 IF (i.eq.
idata)
THEN
3782 IF (
coupled(j)%LinkedGrid(ig,i))
THEN
3783 ie=is+len_trim(
models(j)%name)
3784 string(is:ie)=trim(
models(j)%name)
3789 IF (
coupled(i)%LinkedGrid(ng,j))
THEN
3790 ie=is+len_trim(
models(j)%name)
3791 string(is:ie)=trim(
models(j)%name)
3797 WRITE (out,350) trim(
models(i)%name), ig, &
3798 & trim(
coupled(i)%SetLabel(ng)), &
3799 & trim(
coupled(i)%ImpLabel(ng)), &
3800 & trim(
coupled(i)%ExpLabel(ng)), &
3812 70
FORMAT (80(
'-'),/, &
3813 &
' Earth System Models Coupling: ESMF/NUOPC Library,', &
3814 &
' Version ',a,/,31x,a,/, &
3816 & /,1x,
'Repository Root : ',a, &
3817 & /,1x,
'Operating System : ',a, &
3818 & /,1x,
'CPU Hardware : ',a, &
3819 & /,1x,
'Compiler System : ',a, &
3820 & /,1x,
'Compiler Command : ',a, &
3821 & /,1x,
'Compiler Flags : ',a, &
3822 & /,1x,
'MPI Communicator : ',i0,2x,
'PET size = ',i0, &
3825 90
FORMAT (18x,l1,2x,a,t42,a,i2.2,
'.')
3826 100
FORMAT (18x,l1,2x,a,t42,a)
3827 110
FORMAT (18x,l1,2x,a,t42,
'Connector ',a,
' -> ',a, &
3828 &
' is activated, grid: ',i2.2,
'.')
3829 120
FORMAT (9x,i10,2x,a,t42,a)
3830 130
FORMAT (9x,a,2x,a,t42,a)
3831 150
FORMAT (15x,i4,2x,a,t42,a)
3832 160
FORMAT (i4.4,
'-',i2.2,
'-',i2.2,1x,i2.2,
':',i2.2,
':',i2.2,2x, &
3834 170
FORMAT (7x,a,2x,a,t42,a)
3835 180
FORMAT (18x,i1,2x,a,t42,a,i2.2,
'.')
3836 190
FORMAT (18x,i1,2x,a,t42,a,i2.2)
3837 195
FORMAT (17x,i2,2x,a,t42,a,i2.2)
3838 200
FORMAT (t42,2x,i2.2,
':',1x,a)
3839 210
FORMAT (/,
' read_ESMconfig - Invalid input parameter, ',a, &
3841 220
FORMAT (/,
' read_ESMconfig - Illegal input parameter, ',a, &
3842 &
' for grid ',i2.2,
': ',2i4)
3843 230
FORMAT (/,
' read_ESMconfig - Illegal input parameter, ',a, &
3845 240
FORMAT (/,
' read_ESMconfig - Inconsistent number of PETs for', &
3846 &
' concurrent execution:',/,18x,
'sumPETs = ',i4,2x, &
3847 &
' PETcount = ',i4)
3848 250
FORMAT (/,
' read_ESMconfig - Invalid input parameter, ',a, &
3850 260
FORMAT (/,21x,a,/,21x,a)
3851 270
FORMAT (18x,i1,2x,a,t42,a,i2.2,
'.')
3852 280
FORMAT (t42,2x,i2.2,a,a)
3853 290
FORMAT (t44,
'Coupling Driver PETs: ',a)
3854 300
FORMAT (/,
' read_ESMconfig - ',a,
' Grid ',i2.2, &
3855 &
', could not find input file:',/,18x,a)
3856 310
FORMAT (17x,i2,2x,a,t42,a,/,t44,a)
3857 320
FORMAT (a19,t22,a,t42,a)
3858 330
FORMAT (6x,1p,e13.6,2x,a,t42,a)
3859 340
FORMAT (/,a,/, 42(
'='),/,/,
'Component', t13,
'Grid', &
3860 & t20,
'CoupledSet', t33,
'ImportState', t50,
'ExportState', &
3861 & t67,
'ConnectedTo',/, 114(
'-'))
3862 350
FORMAT (a,t14,i0,t20,a,t33,a,t50,a,t67,a)
4010 integer,
intent(out) :: rc
4012 TYPE (esmf_vm) :: vm
4018 logical :: exist, lreport, connected
4020 integer :: i, id, io_err, j, lvar, varid
4021 integer :: localpet, petcount
4022 integer :: etype, gtype, itype
4024 integer,
parameter :: inp = 10
4026 real(r8) :: add_offset, scale
4028 character (len=:),
allocatable :: smodel
4030 character (len=100) :: sname, units, val
4031 character (len=100) :: shortname, line
4032 character (len=256) :: io_errmsg
4034 character (len=*),
parameter :: myfile = &
4035 & __FILE__//
", set_metadata"
4047 CALL esmf_vmget (vm, &
4048 & localpet=localpet, &
4049 & petcount=petcount, &
4051 IF (esmf_logfounderror(rctocheck=rc, &
4052 & msg=esmf_logerr_passthru, &
4054 & file=myfile))
THEN
4072 IF (
models(i)%IsActive)
THEN
4074 shortname=
models(i)%ImportField(j)%short_name
4077 models(i)%ImportField(j)%connected = s(id)%connected
4078 models(i)%ImportField(j)%debug_write = s(id)%debug_write
4079 models(i)%ImportField(j)%add_offset = s(id)%add_offset
4080 models(i)%ImportField(j)%scale_factor = s(id)%scale
4084 &
models(i)%ImportField(j)%short_name, &
4085 & s(id)%short_name), &
4086 &
noerror, __line__, myfile))
THEN
4087 rc=esmf_rc_copy_fail
4092 &
models(i)%ImportField(j)%standard_name, &
4093 & s(id)%standard_name), &
4094 &
noerror, __line__, myfile))
THEN
4095 rc=esmf_rc_copy_fail
4100 &
models(i)%ImportField(j)%long_name, &
4101 & s(id)%long_name), &
4102 &
noerror, __line__, myfile))
THEN
4103 rc=esmf_rc_copy_fail
4108 &
models(i)%ImportField(j)%dst_gtype, &
4109 & s(id)%destination_grid), &
4110 &
noerror, __line__, myfile))
THEN
4111 rc=esmf_rc_copy_fail
4116 &
models(i)%ImportField(j)%dst_units, &
4117 & s(id)%destination_units), &
4118 &
noerror, __line__, myfile))
THEN
4119 rc=esmf_rc_copy_fail
4124 &
models(i)%ImportField(j)%src_gtype, &
4125 & s(id)%source_grid), &
4126 &
noerror, __line__, myfile))
THEN
4127 rc=esmf_rc_copy_fail
4132 &
models(i)%ImportField(j)%src_units, &
4133 & s(id)%source_units), &
4134 &
noerror, __line__, myfile))
THEN
4135 rc=esmf_rc_copy_fail
4140 &
models(i)%ImportField(j)%nc_vname, &
4141 & s(id)%data_netcdf_vname), &
4142 &
noerror, __line__, myfile))
THEN
4143 rc=esmf_rc_copy_fail
4148 &
models(i)%ImportField(j)%nc_tname, &
4149 & s(id)%data_netcdf_tname), &
4150 &
noerror, __line__, myfile))
THEN
4151 rc=esmf_rc_copy_fail
4156 &
models(i)%ImportField(j)%RegridMethod, &
4157 & s(id)%regrid_method), &
4158 &
noerror, __line__, myfile))
THEN
4159 rc=esmf_rc_copy_fail
4164 &
models(i)%ImportField(j)%ExtrapMethod, &
4165 & s(id)%extrapolate_method), &
4166 &
noerror, __line__, myfile))
THEN
4167 rc=esmf_rc_copy_fail
4172 & s(id)%connected_to), &
4173 &
noerror, __line__, myfile))
THEN
4174 rc=esmf_rc_copy_fail
4179 SELECT CASE (trim(val))
4180 CASE (
'CENTER_CELL',
'CELL_CENTER',
'CENTER')
4182 CASE (
'CORNER_CELL',
'CELL_CORNER',
'CORNER')
4184 CASE (
'U',
'LEFT_RIGHT_EDGE',
'RIGHT_LEFT_EDGE')
4186 CASE (
'V',
'LOWER_UPPER_EDGE',
'UPPER_LOWER_EDGE')
4191 models(i)%ImportField(j)%gtype=gtype
4194 SELECT CASE (trim(val))
4199 CASE (
'CONSERVATIVE1')
4201 CASE (
'CONSERVATIVE2')
4208 models(i)%ImportField(j)%itype=itype
4211 SELECT CASE (trim(val))
4225 models(i)%ImportField(j)%etype=etype
4227 IF (localpet.eq.0)
THEN
4228 WRITE (
cplout,30)
'import field short_name: ', &
4229 & trim(shortname), trim(
cplname)
4231 rc=esmf_rc_not_found
4232 IF (esmf_logfounderror(rctocheck=rc, &
4233 & msg=esmf_logerr_passthru, &
4235 & file=myfile))
RETURN
4251 IF (
models(i)%IsActive)
THEN
4253 shortname=
models(i)%ExportField(j)%short_name
4256 models(i)%ExportField(j)%connected = s(id)%connected
4257 models(i)%ExportField(j)%debug_write = s(id)%debug_write
4258 models(i)%ExportField(j)%add_offset = 0.0_r8
4259 models(i)%ExportField(j)%scale_factor = 1.0_r8
4263 &
models(i)%ExportField(j)%short_name, &
4264 & s(id)%short_name), &
4265 &
noerror, __line__, myfile))
THEN
4266 rc=esmf_rc_copy_fail
4271 &
models(i)%ExportField(j)%standard_name, &
4272 & s(id)%standard_name), &
4273 &
noerror, __line__, myfile))
THEN
4274 rc=esmf_rc_copy_fail
4279 &
models(i)%ExportField(j)%long_name, &
4280 & s(id)%long_name), &
4281 &
noerror, __line__, myfile))
THEN
4282 rc=esmf_rc_copy_fail
4287 &
models(i)%ExportField(j)%dst_gtype, &
4288 & s(id)%destination_grid), &
4289 &
noerror, __line__, myfile))
THEN
4290 rc=esmf_rc_copy_fail
4295 &
models(i)%ExportField(j)%dst_units, &
4296 & s(id)%destination_units), &
4297 &
noerror, __line__, myfile))
THEN
4298 rc=esmf_rc_copy_fail
4303 &
models(i)%ExportField(j)%src_gtype, &
4304 & s(id)%source_grid), &
4305 &
noerror, __line__, myfile))
THEN
4306 rc=esmf_rc_copy_fail
4311 &
models(i)%ExportField(j)%src_units, &
4312 & s(id)%source_units), &
4313 &
noerror, __line__, myfile))
THEN
4314 rc=esmf_rc_copy_fail
4319 &
models(i)%ExportField(j)%nc_vname, &
4320 & s(id)%data_netcdf_vname), &
4321 &
noerror, __line__, myfile))
THEN
4322 rc=esmf_rc_copy_fail
4327 &
models(i)%ExportField(j)%nc_tname, &
4328 & s(id)%data_netcdf_tname), &
4329 &
noerror, __line__, myfile))
THEN
4330 rc=esmf_rc_copy_fail
4335 &
models(i)%ExportField(j)%RegridMethod, &
4336 & s(id)%regrid_method), &
4337 &
noerror, __line__, myfile))
THEN
4338 rc=esmf_rc_copy_fail
4343 &
models(i)%ExportField(j)%ExtrapMethod, &
4344 & s(id)%extrapolate_method), &
4345 &
noerror, __line__, myfile))
THEN
4346 rc=esmf_rc_copy_fail
4351 & s(id)%connected_to), &
4352 &
noerror, __line__, myfile))
THEN
4353 rc=esmf_rc_copy_fail
4358 SELECT CASE (trim(val))
4359 CASE (
'CENTER_CELL',
'CELL_CENTER',
'CENTER')
4361 CASE (
'CORNER_CELL',
'CELL_CORNER',
'CORNER')
4363 CASE (
'U',
'LEFT_RIGHT_EDGE',
'RIGHT_LEFT_EDGE')
4365 CASE (
'V',
'LOWER_UPPER_EDGE',
'UPPER_LOWER_EDGE')
4370 models(i)%ExportField(j)%gtype=gtype
4373 SELECT CASE (trim(val))
4378 CASE (
'CONSERVATIVE1')
4380 CASE (
'CONSERVATIVE2')
4387 models(i)%ExportField(j)%itype=itype
4390 SELECT CASE (trim(val))
4404 models(i)%ExportField(j)%etype=etype
4406 IF (localpet.eq.0)
THEN
4407 WRITE (
cplout,30)
'export field short_name: ', &
4408 & trim(shortname), trim(
cplname)
4410 rc=esmf_rc_not_found
4411 IF (esmf_logfounderror(rctocheck=rc, &
4412 & msg=esmf_logerr_passthru, &
4414 & file=myfile))
RETURN
4425 IF (
models(i)%IsActive)
THEN
4427 sname=
models(i)%ImportField(j)%standard_name
4428 units=
models(i)%ImportField(j)%src_units
4432 exist=nuopc_fielddictionaryhasentry(trim(sname), &
4434 IF (esmf_logfounderror(rctocheck=rc, &
4435 & msg=esmf_logerr_passthru, &
4437 & file=myfile))
THEN
4443 IF (.not.exist)
THEN
4444 CALL nuopc_fielddictionaryaddentry(trim(sname), &
4445 & canonicalunits=trim(units), &
4447 IF (esmf_logfounderror(rctocheck=rc, &
4448 & msg=esmf_logerr_passthru, &
4450 & file=myfile))
THEN
4460 IF ((localpet.eq.0).and.(
models(
iatmos )%IsActive.or. &
4465 WRITE (
cplout,40)
'ESM IMPORT Fields Metadata Dictionary:'
4469 IF (
models(i)%IsActive)
THEN
4471 smodel=trim(
models(i)%name)
4477 & trim(
models(i)%ImportField(j)%short_name), &
4478 & trim(
models(i)%ImportField(j)%standard_name), &
4479 &
models(i)%ImportField(j)%gtype, &
4480 &
models(i)%ImportField(j)%itype, &
4481 &
models(i)%ImportField(j)%etype, &
4482 &
models(i)%ImportField(j)%connected, &
4483 &
models(i)%ImportField(j)%debug_write, &
4484 &
models(i)%ImportField(j)%add_offset, &
4485 &
models(i)%ImportField(j)%scale_factor
4496 IF (
models(i)%IsActive)
THEN
4498 sname=
models(i)%ExportField(j)%standard_name
4499 units=
models(i)%ExportField(j)%src_units
4503 exist=nuopc_fielddictionaryhasentry(trim(sname), &
4505 IF (esmf_logfounderror(rctocheck=rc, &
4506 & msg=esmf_logerr_passthru, &
4508 & file=myfile))
THEN
4514 IF (.not.exist)
THEN
4515 CALL nuopc_fielddictionaryaddentry(trim(sname), &
4516 & canonicalunits=trim(units), &
4518 IF (esmf_logfounderror(rctocheck=rc, &
4519 & msg=esmf_logerr_passthru, &
4521 & file=myfile))
THEN
4531 IF ((localpet.eq.0).and.(
models(
iatmos )%IsActive.or. &
4536 WRITE (
cplout,40)
'ESM EXPORT Fields Metadata Dictionary:'
4540 IF (
models(i)%IsActive)
THEN
4542 smodel=trim(
models(i)%name)
4548 & trim(
models(i)%ExportField(j)%short_name), &
4549 & trim(
models(i)%ExportField(j)%standard_name), &
4550 &
models(i)%ExportField(j)%gtype, &
4551 &
models(i)%ExportField(j)%itype, &
4552 &
models(i)%ExportField(j)%etype, &
4553 &
models(i)%ExportField(j)%connected, &
4554 &
models(i)%ExportField(j)%debug_write, &
4555 &
models(i)%ExportField(j)%add_offset, &
4556 &
models(i)%ExportField(j)%scale_factor
4566 IF (localpet.eq.0)
THEN
4577 OPEN (inp, file=trim(
confname), form=
'formatted', status=
'old', &
4578 & iostat=io_err, iomsg=io_errmsg)
4579 IF (io_err.ne.0)
THEN
4583 rc=esmf_rc_file_open
4590 IF (localpet.eq.0)
THEN
4595 READ (inp,
'(a)',err=10,
END=20) line
4597 IF ((lvar.gt.0).and.(line(1:1).ne.char(35)))
THEN
4598 IF (localpet.eq.0)
WRITE (
cplout,
'(a)') trim(line)
4602 rc=esmf_rc_file_read
4605 IF (localpet.eq.0)
WRITE (
cplout,
'(a)') char(10)
4613 IF (
allocated(s))
deallocate (s)
4614 IF (
allocated(smodel))
deallocate (smodel)
4616 30
FORMAT (/,
' SET_METADATA - cannot find metadata for', &
4617 & 1x,a,
'''',a,
'''.',/,16x, &
4618 &
'Add entry to metadata file: ',a)
4619 40
FORMAT (/,a,/, 37(
'='),/,/,
'Model', t11,
'Short Name', &
4620 & t25,
'Standard Name', t74,
'G', t77,
'I', t80,
'E' t83,
'C', &
4621 & t86,
'W',t90,
'add_offset', t102,
'scale_factor',/, 114(
'-'))
4622 50
FORMAT (a, t11,a, t25,a, t74,i1, t77,i1, t80,i1, t83,l1, t86,l1, &
4623 & t89,1p,e12.5, t103,1p,e12.5)
4624 60
FORMAT (/,
' G: Grid cell location, 1=Center,', &
4628 & /,
' I: Regridding method, 1=bilinear,', &
4630 &
' 3=conservative1', &
4631 &
' 4=conservative2', &
4633 & /,
' E: Extrapolation method, 0=none,', &
4635 &
' 2=inv distance avg,', &
4636 &
' 3=creep fill,', &
4637 &
' 4=two-steps (old way)', &
4638 & /,
' C: Connected to coupler, F=derived from other,', &
4639 &
' T=exchanged/regridded', &
4640 & /,
' W: Field write to NetCDF, F=false, T=true', &
4641 &
' (used if DebugLevel > 2)'/)
4642 70
FORMAT (/,
' SET_METADATA - Unable to open RunSequence ', &
4643 &
' configuration file: ',/,16x,a,/,16x,
'ERROR: ',a, &
4644 & /,16x,
'Prototypes are located in the ESM directory.')
4645 80
FORMAT (/,a,2x,a,/, 25(
'='),/)
4646 90
FORMAT (/,
' SET_METADATA - error while reading RunSequence', &
4647 &
' configuration file: ',a)
4676 integer,
intent(out) :: rc
4678 TYPE (esmf_vm) :: vm
4682 integer :: cdimid, ddimid, fdimid, sdimid, sndimid
4683 integer :: mycomm, romscomm, petcount, localpet
4684 integer :: ncomp,
nfields, i, j, ncid, status, varid
4685 integer :: ibuffer(3)
4687 integer,
parameter :: natt = 25
4688 integer,
parameter :: ng = 1
4689 integer,
parameter :: ikernel = 1
4693 character (len= 80) :: text
4694 character (len=MaxLen) :: vinfo(natt)
4696 character (len=*),
parameter :: myfile = &
4697 & __FILE__//
", def_FieldAtt"
4712 CALL esmf_vmget (vm, &
4713 & localpet=localpet, &
4714 & petcount=petcount, &
4715 & mpicommunicator=mycomm, &
4717 IF (esmf_logfounderror(rctocheck=rc, &
4718 & msg=esmf_logerr_passthru, &
4720 & file=myfile))
THEN
4738 DO j=1,len(vinfo(1))
4752 rc=esmf_rc_file_create
4760 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
4761 rc=esmf_rc_file_create
4769 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
4770 rc=esmf_rc_file_create
4778 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
4779 rc=esmf_rc_file_create
4787 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
4788 rc=esmf_rc_file_create
4795 & nf90_unlimited, sdimid)
4796 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
4797 rc=esmf_rc_file_create
4805 text=
'ROMS ESMF/NUOPC coupling, '// &
4806 &
'field metadata for time interpolation between snapshots'
4807 IF (localpet.eq.0)
THEN
4808 status=nf90_put_att(ncid, nf90_global,
'type', &
4810 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
4812 rc=esmf_rc_file_create
4824 IF (esmf_logfounderror(rctocheck=rc, &
4825 & msg=esmf_logerr_passthru, &
4827 & file=myfile))
RETURN
4829 IF (localpet.eq.0)
THEN
4830 status=nf90_put_att(ncid, nf90_global,
'file', &
4832 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
4834 rc=esmf_rc_file_create
4846 IF (esmf_logfounderror(rctocheck=rc, &
4847 & msg=esmf_logerr_passthru, &
4849 & file=myfile))
RETURN
4852 IF (localpet.eq.0)
THEN
4853 status=nf90_put_att(ncid, nf90_global,
'Conventions', &
4855 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
4857 rc=esmf_rc_file_create
4869 IF (esmf_logfounderror(rctocheck=rc, &
4870 & msg=esmf_logerr_passthru, &
4872 & file=myfile))
RETURN
4877 vinfo(2)=
'field short name'
4878 status=
def_var(ng, ikernel, ncid, varid, nf90_char, &
4879 & 3, (/sndimid,cdimid,fdimid/), aval, vinfo, &
4881 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
4882 rc=esmf_rc_file_create
4889 vinfo(2)=
'current time snapshot rolling index'
4890 status=
def_var(ng, ikernel, ncid, varid, nf90_int, &
4891 & 3, (/cdimid,fdimid,sdimid/), aval, vinfo, &
4893 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
4894 rc=esmf_rc_file_create
4901 vinfo(2)=
'field snapshot date'
4902 status=
def_var(ng, ikernel, ncid, varid, nf90_char, &
4903 & 4, (/ddimid,cdimid,fdimid,sdimid/), aval, vinfo, &
4905 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
4906 rc=esmf_rc_file_create
4913 vinfo(2)=
'current coupling time'
4914 vinfo(3)=
'days since '// &
4917 & 3, (/cdimid,fdimid,sdimid/), aval, vinfo, &
4919 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
4920 rc=esmf_rc_file_create
4927 vinfo(2)=
'field lower time snapshot'
4928 vinfo(3)=
'days since '// &
4931 & 3, (/cdimid,fdimid,sdimid/), aval, vinfo, &
4933 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
4934 rc=esmf_rc_file_create
4941 vinfo(2)=
'field upper time snapshot'
4943 & 3, (/cdimid,fdimid,sdimid/), aval, vinfo, &
4945 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
4946 rc=esmf_rc_file_create
4953 vinfo(2)=
'field monotonic time for interpolation'
4954 vinfo(3)=
'days since '// &
4957 & 3, (/cdimid,fdimid,sdimid/), aval, vinfo, &
4959 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
4960 rc=esmf_rc_file_create
4967 vinfo(2)=
'field variable current time snapshots'
4968 vinfo(3)=
'days since '// &
4971 & 3, (/cdimid,fdimid,sdimid/), aval, vinfo, &
4973 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
4974 rc=esmf_rc_file_create
4981 vinfo(2)=
'field time minimum in data'
4982 vinfo(3)=
'days since '// &
4985 & 3, (/cdimid,fdimid,sdimid/), aval, vinfo, &
4987 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
4988 rc=esmf_rc_file_create
4995 vinfo(2)=
'field time maximum in data'
4996 vinfo(3)=
'days since '// &
4999 & 3, (/cdimid,fdimid,sdimid/), aval, vinfo, &
5001 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
5002 rc=esmf_rc_file_create
5012 rc=esmf_rc_file_create
5023 rc=esmf_rc_file_create
5031 10
FORMAT (/,
' def_FieldAtt - unable to create NetCDF file: ',a)
5032 20
FORMAT (/,
' def_FieldAtt - error while creating global', &
5033 &
' attribute: ', a,/,16x,a)