Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Update dmodel ioformat #1778

Merged
merged 18 commits into from
Aug 1, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 0 additions & 3 deletions scripts/Tools/case.qstatus
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ Show the batch status of all jobs associated with this case.
from standard_script_setup import *

from CIME.case import Case
from CIME.utils import find_system_test
from CIME.XML.files import Files
from CIME.XML.component import Component
from CIME.test_status import *

###############################################################################
Expand Down
12 changes: 5 additions & 7 deletions scripts/Tools/check_input_data
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,11 @@ Should be run from case.
from standard_script_setup import *

from CIME.utils import get_model
from CIME.XML.machines import Machines
from CIME.check_input_data import check_input_data, SVN_LOCS
from CIME.case import Case

import argparse, doctest

MACHINE = Machines()

###############################################################################
def parse_command_line(args, description):
###############################################################################
Expand All @@ -41,10 +38,11 @@ formatter_class=argparse.ArgumentDefaultsHelpFormatter
parser.add_argument("--svn-loc", default=SVN_LOCS[get_model()],
help="The input data repository from which to download data.")

parser.add_argument("-i", "--input-data-root", default=None,
help="The root directory where input data goes. "
"Default value will come from DIN_LOC_ROOT from case which itself "
"defaults to '{}'".format(MACHINE.get_value("DIN_LOC_ROOT")))

parser.add_argument("-i", "--input-data-root",default=None,
help="The root directory where input data goes, "
"use xmlquery DIN_LOC_ROOT to see default value.")


parser.add_argument("--data-list-dir", default="Buildconf",
help="Where to find list of input files")
Expand Down
4 changes: 2 additions & 2 deletions scripts/lib/CIME/XML/env_batch.py
Original file line number Diff line number Diff line change
Expand Up @@ -572,8 +572,8 @@ def get_status(self, jobid):

cmd += jobid

stat, out, err = run_cmd(cmd)
if stat != 0:
status, out, err = run_cmd(cmd)
if status != 0:
logger.warning("Batch query command '{}' failed with error '{}'".format(cmd, err))
else:
return out.strip()
25 changes: 10 additions & 15 deletions src/components/data_comps/datm/datm_comp_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ module datm_comp_mod

use shr_strdata_mod
use shr_dmodel_mod
use shr_pcdf_mod
use datm_shr_mod

use seq_cdata_mod
Expand Down Expand Up @@ -104,7 +103,7 @@ module datm_comp_mod
integer(IN) :: sprecc,sprecl,sprecn,sco2p,sco2d,sswup,sprec,starcf

!
! water isotopes / tracer input
! water isotopes / tracer input
integer(IN) :: &
kshum_16O, kshum_18O, kshum_HDO, &
krc_18O, krc_HDO, &
Expand Down Expand Up @@ -265,19 +264,18 @@ module datm_comp_mod

subroutine datm_comp_init( EClock, cdata, x2a, a2x, NLFilename )
use pio, only : iosystem_desc_t
use shr_pio_mod, only : shr_pio_getiosys, shr_pio_getiotype
implicit none
implicit none

! !INPUT/OUTPUT PARAMETERS:
! !INPUT/OUTPUT PARAMETERS:

type(ESMF_Clock) , intent(in) :: EClock
type(seq_cdata) , intent(inout) :: cdata
type(mct_aVect) , intent(inout) :: x2a, a2x
character(len=*), optional , intent(in) :: NLFilename ! Namelist filename
type(ESMF_Clock) , intent(in) :: EClock
type(seq_cdata) , intent(inout) :: cdata
type(mct_aVect) , intent(inout) :: x2a, a2x
character(len=*), optional , intent(in) :: NLFilename ! Namelist filename

!EOP
!EOP

!--- local variables ---
!--- local variables ---
integer(IN) :: n,k ! generic counters
integer(IN) :: ierr ! error code
integer(IN) :: gsize ! global size
Expand All @@ -294,7 +292,6 @@ subroutine datm_comp_init( EClock, cdata, x2a, a2x, NLFilename )
type(seq_infodata_type), pointer :: infodata
type(mct_gsMap) , pointer :: gsMap
type(mct_gGrid) , pointer :: ggrid
type(iosystem_desc_t) , pointer :: iosystem

character(CL) :: filePath ! generic file path
character(CL) :: fileName ! generic file name
Expand Down Expand Up @@ -460,9 +457,7 @@ subroutine datm_comp_init( EClock, cdata, x2a, a2x, NLFilename )
! Initialize PIO
!----------------------------------------------------------------------------

iosystem => shr_pio_getiosys(trim(inst_name))
call shr_strdata_pioinit(SDATM, iosystem, &
shr_pio_getiotype(trim(inst_name)))
call shr_strdata_pioinit(SDATM, COMPID)

!----------------------------------------------------------------------------
! Validate mode
Expand Down
45 changes: 20 additions & 25 deletions src/components/data_comps/dice/dice_comp_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ module dice_comp_mod
integer(IN) :: logunit ! logging unit number
integer :: inst_index ! number of current instance (ie. 1)
character(len=16) :: inst_name ! fullname of current instance (ie. "lnd_0001")
character(len=16) :: inst_suffix ! char string associated with instance
character(len=16) :: inst_suffix ! char string associated with instance
! (ie. "_0001" or "")
character(CL) :: ice_mode ! mode
integer(IN) :: dbug = 0 ! debug level (higher is more)
Expand All @@ -76,7 +76,7 @@ module dice_comp_mod

real(R8),parameter :: pi = shr_const_pi ! pi
real(R8),parameter :: spval = shr_const_spval ! flags invalid data
real(R8),parameter :: tFrz = shr_const_tkfrz ! temp of freezing
real(R8),parameter :: tFrz = shr_const_tkfrz ! temp of freezing
real(R8),parameter :: latice = shr_const_latice ! latent heat of fusion
real(R8),parameter :: cDay = shr_const_cDay ! sec in calendar day
real(R8),parameter :: waterMax = 1000.0_R8 ! wrt iFrac comp & frazil ice (kg/m^2)
Expand Down Expand Up @@ -160,7 +160,6 @@ module dice_comp_mod

subroutine dice_comp_init( EClock, cdata, x2i, i2x, NLFilename )
use pio, only : iosystem_desc_t
use shr_pio_mod, only : shr_pio_getiosys, shr_pio_getiotype
implicit none

! !INPUT/OUTPUT PARAMETERS:
Expand Down Expand Up @@ -209,8 +208,6 @@ subroutine dice_comp_init( EClock, cdata, x2i, i2x, NLFilename )
logical :: force_prognostic_true ! if true set prognostic true
logical :: exists ! file existance logical
integer(IN) :: nu ! unit number
type(iosystem_desc_t), pointer :: ice_pio_subsystem


!----- define namelist -----
namelist / dice_nml / &
Expand Down Expand Up @@ -286,7 +283,7 @@ subroutine dice_comp_init( EClock, cdata, x2i, i2x, NLFilename )
decomp = "1d"
flux_swpf = 0.0_R8 ! no penetration
flux_Qmin = -300.0_R8 ! kg/s/m^2
flux_Qacc = .false. ! no accumulation
flux_Qacc = .false. ! no accumulation
flux_Qacc0 = 0.0_R8 ! no water
restfilm = trim(nullstr)
restfils = trim(nullstr)
Expand Down Expand Up @@ -335,11 +332,8 @@ subroutine dice_comp_init( EClock, cdata, x2i, i2x, NLFilename )
!----------------------------------------------------------------------------
! Initialize IO
!----------------------------------------------------------------------------


ice_pio_subsystem=>shr_pio_getiosys(trim(inst_name))

call shr_strdata_pioinit(SDICE, ice_pio_subsystem, shr_pio_getiotype(trim(inst_name)))
call shr_strdata_pioinit(SDICE, COMPID )

!----------------------------------------------------------------------------
! Validate mode
Expand Down Expand Up @@ -539,7 +533,7 @@ subroutine dice_comp_init( EClock, cdata, x2i, i2x, NLFilename )
call shr_mpi_bcast(exists,mpicom,'exists')
if (my_task == master_task) write(logunit,F00) ' reading ',trim(rest_file)
call shr_pcdf_readwrite('read',SDICE%pio_subsystem, SDICE%io_type, &
trim(rest_file),mpicom,gsmap,rf1=water,rf1n='water')
trim(rest_file),mpicom,gsmap=gsmap,rf1=water,rf1n='water',io_format=SDICE%io_format)
if (exists) then
if (my_task == master_task) write(logunit,F00) ' reading ',trim(rest_file_strm)
call shr_strdata_restRead(trim(rest_file_strm),SDICE,mpicom)
Expand Down Expand Up @@ -703,14 +697,14 @@ subroutine dice_comp_run( EClock, cdata, x2i, i2x)

select case (trim(ice_mode))

case('COPYALL')
case('COPYALL')
! do nothing extra

case('SSTDATA')
if (firstcall .and. .not. read_restart) then
! iFrac0 = iFrac ! previous step's ice fraction
water = 0.0_R8 ! previous step's water accumulation
where (i2x%rAttr(kiFrac,:) > 0.0_R8) water(:) = flux_Qacc0
where (i2x%rAttr(kiFrac,:) > 0.0_R8) water(:) = flux_Qacc0
endif

! tcraig, feb 10, 2012, ymd2eday no longer exists, use ymd2julian instead
Expand All @@ -729,20 +723,20 @@ subroutine dice_comp_run( EClock, cdata, x2i, i2x)
do n = 1,lsize

!--- fix erroneous iFrac ---
i2x%rAttr(kiFrac,n) = min(1.0_R8,max(0.0_R8,i2x%rAttr(kiFrac,n)))
i2x%rAttr(kiFrac,n) = min(1.0_R8,max(0.0_R8,i2x%rAttr(kiFrac,n)))

!--- fabricate ice surface T, fix erroneous iFrac ---
if ( yc(n) > 0.0_R8) then
if ( yc(n) > 0.0_R8) then
i2x%rAttr(kt,n) = 260.0_R8 + 10.0_R8*cos(cosArg)
else
i2x%rAttr(kt,n) = 260.0_R8 - 10.0_R8*cos(cosArg)
end if

!--- set albedos (constant) ---
i2x%rAttr(kavsdr,n) = ax_vsdr
i2x%rAttr(kanidr,n) = ax_nidr
i2x%rAttr(kavsdf,n) = ax_vsdf
i2x%rAttr(kanidf,n) = ax_nidf
i2x%rAttr(kavsdr,n) = ax_vsdr
i2x%rAttr(kanidr,n) = ax_nidr
i2x%rAttr(kavsdf,n) = ax_vsdf
i2x%rAttr(kanidf,n) = ax_nidf

!--- swnet is sent to cpl as a diagnostic quantity only ---
!--- newly recv'd swdn goes with previously sent albedo ---
Expand Down Expand Up @@ -809,7 +803,7 @@ subroutine dice_comp_run( EClock, cdata, x2i, i2x)
end if

!--- modify T wrt iFrac: (iFrac -> 0) => (T -> tfreeze) ---
i2x%rAttr(kt,n) = tfreeze(n) + i2x%rAttr(kiFrac,n)*(i2x%rAttr(kt,n)-tfreeze(n))
i2x%rAttr(kt,n) = tfreeze(n) + i2x%rAttr(kiFrac,n)*(i2x%rAttr(kt,n)-tfreeze(n))

end do

Expand Down Expand Up @@ -883,7 +877,8 @@ subroutine dice_comp_run( EClock, cdata, x2i, i2x)
endif
if (my_task == master_task) write(logunit,F04) ' writing ',trim(rest_file),currentYMD,currentTOD
call shr_pcdf_readwrite('write',SDICE%pio_subsystem, SDICE%io_type, &
trim(rest_file),mpicom,gsmap,clobber=.true.,rf1=water,rf1n='water')
trim(rest_file),mpicom,gsmap=gsmap,clobber=.true.,rf1=water,rf1n='water',&
io_format=SDICE%io_format)
if (my_task == master_task) write(logunit,F04) ' writing ',trim(rest_file_strm),currentYMD,currentTOD
call shr_strdata_restWrite(trim(rest_file_strm),SDICE,mpicom,trim(case_name),'SDICE strdata')
call shr_sys_flush(logunit)
Expand All @@ -903,7 +898,7 @@ subroutine dice_comp_run( EClock, cdata, x2i, i2x)
call shr_sys_flush(logunit)
end if
firstcall = .false.

call shr_file_setLogUnit (shrlogunit)
call shr_file_setLogLevel(shrloglev)
call shr_sys_flush(logunit)
Expand Down Expand Up @@ -943,11 +938,11 @@ subroutine dice_comp_final()
call t_startf('DICE_FINAL')

if (my_task == master_task) then
write(logunit,F91)
write(logunit,F91)
write(logunit,F00) trim(myModelName),': end of main integration loop'
write(logunit,F91)
write(logunit,F91)
end if

call t_stopf('DICE_FINAL')

end subroutine dice_comp_final
Expand Down
Loading