From 28670bc66b43316b138f4082def8e74fc73d9d42 Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Mon, 31 Jul 2017 15:32:43 -0600 Subject: [PATCH 01/16] update pio_format in dmodels --- .../data_comps/datm/datm_comp_mod.F90 | 25 +++++------ .../data_comps/dice/dice_comp_mod.F90 | 45 +++++++++---------- .../data_comps/docn/docn_comp_mod.F90 | 36 +++++++-------- .../data_comps/drof/drof_comp_mod.F90 | 11 +---- src/share/util/shr_mct_mod.F90 | 6 +-- src/share/util/shr_pcdf_mod.F90 | 20 +++++---- src/share/util/shr_strdata_mod.F90 | 27 ++++++----- 7 files changed, 76 insertions(+), 94 deletions(-) diff --git a/src/components/data_comps/datm/datm_comp_mod.F90 b/src/components/data_comps/datm/datm_comp_mod.F90 index 28c0fbd66a1..9f618503900 100644 --- a/src/components/data_comps/datm/datm_comp_mod.F90 +++ b/src/components/data_comps/datm/datm_comp_mod.F90 @@ -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 @@ -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, & @@ -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 @@ -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 @@ -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 diff --git a/src/components/data_comps/dice/dice_comp_mod.F90 b/src/components/data_comps/dice/dice_comp_mod.F90 index 692b07c2c64..c64dec27b0a 100644 --- a/src/components/data_comps/dice/dice_comp_mod.F90 +++ b/src/components/data_comps/dice/dice_comp_mod.F90 @@ -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) @@ -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) @@ -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: @@ -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 / & @@ -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) @@ -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 @@ -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) @@ -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 @@ -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 --- @@ -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 @@ -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) @@ -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) @@ -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 diff --git a/src/components/data_comps/docn/docn_comp_mod.F90 b/src/components/data_comps/docn/docn_comp_mod.F90 index 84535338a06..f104df22aca 100644 --- a/src/components/data_comps/docn/docn_comp_mod.F90 +++ b/src/components/data_comps/docn/docn_comp_mod.F90 @@ -56,7 +56,7 @@ module docn_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) :: ocn_mode ! mode integer(IN) :: dbug = 0 ! debug level (higher is more) @@ -127,7 +127,6 @@ module docn_comp_mod ! !INTERFACE: ------------------------------------------------------------------ subroutine docn_comp_init( EClock, cdata, x2o, o2x, NLFilename ) - use shr_pio_mod, only : shr_pio_getiosys, shr_pio_getiotype implicit none ! !INPUT/OUTPUT PARAMETERS: @@ -276,7 +275,7 @@ subroutine docn_comp_init( EClock, cdata, x2o, o2x, NLFilename ) call shr_mpi_bcast(restfilm,mpicom,'restfilm') call shr_mpi_bcast(restfils,mpicom,'restfils') call shr_mpi_bcast(force_prognostic_true,mpicom,'force_prognostic_true') - + rest_file = trim(restfilm) rest_file_strm = trim(restfils) if (force_prognostic_true) then @@ -339,9 +338,8 @@ subroutine docn_comp_init( EClock, cdata, x2o, o2x, NLFilename ) if (trim(ocn_mode) /= 'NULL') then ocn_present = .true. call seq_timemgr_EClockGetData( EClock, calendar=calendar ) - iosystem => shr_pio_getiosys(trim(inst_name)) - - call shr_strdata_pioinit(SDOCN, iosystem, shr_pio_getiotype(trim(inst_name))) + + call shr_strdata_pioinit(SDOCN, compid) if (scmmode) then if (my_task == master_task) & @@ -407,8 +405,8 @@ subroutine docn_comp_init( EClock, cdata, x2o, o2x, NLFilename ) call shr_dmodel_rearrGGrid(SDOCN%grid, ggrid, gsmap, rearr, mpicom) end if - ! Special logic for either prescribed or som aquaplanet - overwrite and - ! set mask/frac to 1 + ! Special logic for either prescribed or som aquaplanet - overwrite and + ! set mask/frac to 1 if (ocn_mode == 'SST_AQUAPANAL' .or. ocn_mode == 'SST_AQUAPFILE' .or. ocn_mode == 'SOM_AQUAP') then kmask = mct_aVect_indexRA(ggrid%data,'mask') ggrid%data%rattr(kmask,:) = 1 @@ -510,7 +508,7 @@ subroutine docn_comp_init( EClock, cdata, x2o, o2x, NLFilename ) call shr_mpi_bcast(exists,mpicom,'exists') if (trim(ocn_mode) == 'SOM' .or. trim(ocn_mode) == 'SOM_AQUAP') then if (my_task == master_task) write(logunit,F00) ' reading ',trim(rest_file) - call shr_pcdf_readwrite('read',iosystem,SDOCN%io_type,trim(rest_file),mpicom,gsmap,rf1=somtp,rf1n='somtp') + call shr_pcdf_readwrite('read',SDOCN%pio_subsystem,SDOCN%io_type,trim(rest_file),mpicom,gsmap=gsmap,rf1=somtp,rf1n='somtp',io_format=SDOCN%io_format) endif if (exists) then if (my_task == master_task) write(logunit,F00) ' reading ',trim(rest_file_strm) @@ -595,7 +593,7 @@ subroutine docn_comp_run( EClock, cdata, x2o, o2x) type(seq_infodata_type), pointer :: infodata real(R8), parameter :: swp = 0.67_R8*(exp((-1._R8*shr_const_zsrflyr) & - /1.0_R8)) + 0.33_R8*exp((-1._R8*shr_const_zsrflyr)/17.0_R8) + /1.0_R8)) + 0.33_R8*exp((-1._R8*shr_const_zsrflyr)/17.0_R8) character(*), parameter :: F00 = "('(docn_comp_run) ',8a)" character(*), parameter :: F04 = "('(docn_comp_run) ',2a,2i8,'s')" character(*), parameter :: subName = "(docn_comp_run) " @@ -669,7 +667,7 @@ subroutine docn_comp_run( EClock, cdata, x2o, o2x) select case (trim(ocn_mode)) - case('COPYALL') + case('COPYALL') ! do nothing extra case('SSTDATA') @@ -742,7 +740,7 @@ subroutine docn_comp_run( EClock, cdata, x2o, o2x) hn = avstrm%rAttr(kh,n) !--- compute new temp --- o2x%rAttr(kt,n) = somtp(n) + & - (x2o%rAttr(kswnet,n) + & ! shortwave + (x2o%rAttr(kswnet,n) + & ! shortwave x2o%rAttr(klwup ,n) + & ! longwave x2o%rAttr(klwdn ,n) + & ! longwave x2o%rAttr(ksen ,n) + & ! sensible @@ -779,7 +777,7 @@ subroutine docn_comp_run( EClock, cdata, x2o, o2x) hn = avstrm%rAttr(kh,n) !--- compute new temp --- o2x%rAttr(kt,n) = somtp(n) + & - (x2o%rAttr(kswnet,n) + & ! shortwave + (x2o%rAttr(kswnet,n) + & ! shortwave x2o%rAttr(klwup ,n) + & ! longwave x2o%rAttr(klwdn ,n) + & ! longwave x2o%rAttr(ksen ,n) + & ! sensible @@ -839,7 +837,7 @@ subroutine docn_comp_run( EClock, cdata, x2o, o2x) call shr_sys_flush(logunit) end if firstcall = .false. - + call shr_file_setLogUnit (shrlogunit) call shr_file_setLogLevel(shrloglev) call shr_sys_flush(logunit) @@ -878,11 +876,11 @@ subroutine docn_comp_final() call t_startf('DOCN_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('DOCN_FINAL') end subroutine docn_comp_final @@ -912,7 +910,7 @@ subroutine prescribed_sst(xc, yc, lsize, sst_option, sst) real(r8), parameter :: shift = 5._r8*pio180 real(r8), parameter :: shift9 = 10._r8*pio180 real(r8), parameter :: shift10 = 15._r8*pio180 - + ! Parameters for zonally asymmetric experiments real(r8), parameter :: t0_max6 = 1._r8 real(r8), parameter :: t0_max7 = 3._r8 @@ -1001,7 +999,7 @@ subroutine prescribed_sst(xc, yc, lsize, sst_option, sst) tmp = 1._r8 - tmp*tmp sst(i) = tmp*(t0_max - t0_min) + t0_min else - tmp = sin((rlat(i)-shift)*pi*0.5_r8/(maxlat+shift)) + tmp = sin((rlat(i)-shift)*pi*0.5_r8/(maxlat+shift)) tmp = 1._r8 - tmp*tmp sst(i) = tmp*(t0_max - t0_min) + t0_min end if diff --git a/src/components/data_comps/drof/drof_comp_mod.F90 b/src/components/data_comps/drof/drof_comp_mod.F90 index a2c9974bd3a..02791a0f099 100644 --- a/src/components/data_comps/drof/drof_comp_mod.F90 +++ b/src/components/data_comps/drof/drof_comp_mod.F90 @@ -86,9 +86,6 @@ module drof_comp_mod ! !INTERFACE: ------------------------------------------------------------------ subroutine drof_comp_init( EClock, cdata, x2r, r2x, NLFilename ) - - use shr_pio_mod, only : shr_pio_getiosys, shr_pio_getiotype - use pio, only : iosystem_desc_t implicit none ! !INPUT/OUTPUT PARAMETERS: @@ -141,9 +138,6 @@ subroutine drof_comp_init( EClock, cdata, x2r, r2x, NLFilename ) logical :: exists_r ! file existance logical integer(IN) :: nu ! unit number - type(iosystem_desc_t), pointer :: rof_pio_subsys - integer(IN) :: rof_pio_iotype - !----- define namelist ----- namelist / drof_nml / & decomp, restfilm, restfils, & @@ -270,15 +264,12 @@ subroutine drof_comp_init( EClock, cdata, x2r, r2x, NLFilename ) call t_startf('drof_strdata_init') - rof_pio_subsys => shr_pio_getiosys(trim(inst_name)) - rof_pio_iotype = shr_pio_getiotype(trim(inst_name)) - call seq_timemgr_EClockGetData( EClock, calendar=calendar ) if (trim(rof_mode) /= 'NULL') then rof_present = .true. rofice_present = .true. - call shr_strdata_pioinit(SDROF,rof_pio_subsys,rof_pio_iotype) + call shr_strdata_pioinit(SDROF, compid) call shr_strdata_init(SDROF,mpicom,compid,name='rof',& calendar=calendar) endif diff --git a/src/share/util/shr_mct_mod.F90 b/src/share/util/shr_mct_mod.F90 index b14b20ec6d8..5927a4bb8c2 100644 --- a/src/share/util/shr_mct_mod.F90 +++ b/src/share/util/shr_mct_mod.F90 @@ -785,7 +785,7 @@ end subroutine shr_mct_sMatReaddnc ! ! !INTERFACE: ----------------------------------------------------------------- -subroutine shr_mct_sMatWritednc(sMat,iosystem, io_type, fileName,compid, mpicom) +subroutine shr_mct_sMatWritednc(sMat,iosystem, io_type, io_format, fileName,compid, mpicom) ! !USES: use pio, only : iosystem_desc_t @@ -798,6 +798,7 @@ subroutine shr_mct_sMatWritednc(sMat,iosystem, io_type, fileName,compid, mpicom) type(mct_sMat) ,intent(in) :: sMat ! mapping data type(iosystem_desc_t) :: iosystem ! PIO subsystem description integer(IN) ,intent(in) :: io_type ! type of io interface for this file + integer(IN) ,intent(in) :: io_format ! type of io netcdf3 format for this file character(*) ,intent(in) :: filename ! netCDF file to read integer(IN) ,intent(in) :: compid ! processor id integer(IN) ,intent(in) :: mpicom ! communicator @@ -856,7 +857,7 @@ subroutine shr_mct_sMatWritednc(sMat,iosystem, io_type, fileName,compid, mpicom) AV%rAttr(1,:) = expvarr(:) deallocate(expvarr) - call shr_pcdf_readwrite('write',iosystem,io_type, trim(filename),mpicom,gsmap,clobber=.false.,cdf64=.true., & + call shr_pcdf_readwrite('write',iosystem,io_type, trim(filename),mpicom,gsmap,clobber=.false.,io_format=io_format, & id1=na,id1n='n_a',id2=nb,id2n='n_b',id3=ns,id3n='n_s',av1=AV,av1n='') call mct_gsmap_clean(gsmap) @@ -866,4 +867,3 @@ end subroutine shr_mct_sMatWritednc !=============================================================================== end module shr_mct_mod - diff --git a/src/share/util/shr_pcdf_mod.F90 b/src/share/util/shr_pcdf_mod.F90 index a5ca0423ef4..d839c30fddc 100644 --- a/src/share/util/shr_pcdf_mod.F90 +++ b/src/share/util/shr_pcdf_mod.F90 @@ -56,7 +56,8 @@ module shr_pcdf_mod !=============================================================================== contains !=============================================================================== -subroutine shr_pcdf_readwrite(type,iosystem,pio_iotype,filename,mpicom,gsmap,dof,clobber,cdf64, & +subroutine shr_pcdf_readwrite(type,iosystem,pio_iotype,filename,& + mpicom,gsmap,dof,clobber,io_format, & id1,id1n,rs1,rs1n,is1,is1n,rf1,rf1n,if1,if1n,av1,av1n, & id2,id2n,rs2,rs2n,is2,is2n,rf2,rf2n,if2,if2n,av2,av2n, & id3,id3n,rs3,rs3n,is3,is3n,rf3,rf3n,if3,if3n,av3,av3n, & @@ -76,7 +77,8 @@ subroutine shr_pcdf_readwrite(type,iosystem,pio_iotype,filename,mpicom,gsmap,dof !--- optional settings --- logical , optional, intent(in) :: clobber - logical , optional, intent(in) :: cdf64 + integer(IN), optional, intent(in) :: io_format + ! add root, stride, ntasks, netcdf/pnetcdf, etc !--- data to write --- @@ -145,7 +147,7 @@ subroutine shr_pcdf_readwrite(type,iosystem,pio_iotype,filename,mpicom,gsmap,dof logical :: readtype integer(IN) :: lsize,gsize logical :: lclobber - logical :: lcdf64 + integer :: lio_format logical :: exists integer :: nmode character(CL) :: fname @@ -175,8 +177,8 @@ subroutine shr_pcdf_readwrite(type,iosystem,pio_iotype,filename,mpicom,gsmap,dof lclobber = .false. if (present(clobber)) lclobber=clobber - lcdf64 = .false. - if (present(cdf64)) lcdf64=cdf64 + lio_format = PIO_64BIT_OFFSET + if (present(io_format)) lio_format=io_format call mpi_comm_size(mpicom,ntasks,ier) call mpi_comm_rank(mpicom,iam,ier) @@ -185,7 +187,7 @@ subroutine shr_pcdf_readwrite(type,iosystem,pio_iotype,filename,mpicom,gsmap,dof write(shr_log_unit,*) subname,' filename = ',trim(filename) write(shr_log_unit,*) subname,' type = ',trim(type) write(shr_log_unit,*) subname,' clobber = ',lclobber - write(shr_log_unit,*) subname,' cdf64 = ',lcdf64 + write(shr_log_unit,*) subname,' io_format = ',lio_format call shr_sys_flush(shr_log_unit) endif @@ -228,11 +230,13 @@ subroutine shr_pcdf_readwrite(type,iosystem,pio_iotype,filename,mpicom,gsmap,dof endif if (lclobber .or. .not.exists) then nmode = pio_clobber - if (lcdf64) nmode = ior(nmode,PIO_64BIT_OFFSET) + if(pio_iotype .eq. PIO_IOTYPE_NETCDF .or. & + pio_iotype .eq. PIO_IOTYPE_PNETCDF) then + nmode = ior(nmode,lio_format) + endif rcode = pio_createfile(iosystem, fid, pio_iotype, trim(filename), nmode) else nmode = pio_write - if (lcdf64) nmode = ior(nmode,PIO_64BIT_OFFSET) rcode = pio_openfile(iosystem, fid, pio_iotype, trim(filename), nmode) endif rcode = pio_put_att(fid,pio_global,"file_version",version) diff --git a/src/share/util/shr_strdata_mod.F90 b/src/share/util/shr_strdata_mod.F90 index 2afab33ca56..f4cb03080a7 100644 --- a/src/share/util/shr_strdata_mod.F90 +++ b/src/share/util/shr_strdata_mod.F90 @@ -96,7 +96,8 @@ module shr_strdata_mod character(CL) :: mapwrit (nStrMax) ! regrid mapping file to write character(CL) :: tintalgo(nStrMax) ! time interpolation algorithm character(CL) :: readmode(nStrMax) ! file read mode - integer(IN) :: io_type + integer(IN) :: io_type + integer(IN) :: io_format !--- data required by cosz t-interp method, set by user --- real(R8) :: eccen @@ -335,7 +336,7 @@ subroutine shr_strdata_init(SDAT,mpicom,compid,name,scmmode,scmlon,scmlat, & else - ! NOTE: if the stream model domainfile is 'null' (or shr_strdata_nullstr), + ! NOTE: if the stream model domainfile is 'null' (or shr_strdata_nullstr), ! then set the model domain to the domain of the first stream if (trim(SDAT%domainfile) == trim(shr_strdata_nullstr)) then @@ -415,7 +416,7 @@ subroutine shr_strdata_init(SDAT,mpicom,compid,name,scmmode,scmlon,scmlat, & write(logunit,F00) ' writing ',trim(SDAT%fillwrit(n)) call shr_sys_flush(logunit) endif - call shr_mct_sMatWritednc(SDAT%sMatPf(n)%Matrix,SDAT%pio_subsystem,sdat%io_type, SDAT%fillwrit(n),compid,mpicom) + call shr_mct_sMatWritednc(SDAT%sMatPf(n)%Matrix,SDAT%pio_subsystem,sdat%io_type, SDAT%io_format, SDAT%fillwrit(n),compid,mpicom) endif else if (my_task == master_task) then @@ -450,7 +451,8 @@ subroutine shr_strdata_init(SDAT,mpicom,compid,name,scmmode,scmlon,scmlat, & write(logunit,F00) ' writing ',trim(SDAT%mapwrit(n)) call shr_sys_flush(logunit) endif - call shr_mct_sMatWritednc(SDAT%sMatPs(n)%Matrix,sdat%pio_subsystem,sdat%io_type,SDAT%mapwrit(n),compid,mpicom) + call shr_mct_sMatWritednc(SDAT%sMatPs(n)%Matrix,sdat%pio_subsystem,& + sdat%io_type,SDAT%io_format,SDAT%mapwrit(n),compid,mpicom) endif else if (my_task == master_task) then @@ -1298,13 +1300,15 @@ end subroutine shr_strdata_readnml ! 2010-10-26 Jim Edwards ! ! !INTERFACE: ------------------------------------------------------------------ -subroutine shr_strdata_pioinit(SDAT,io_subsystem, io_type ) +subroutine shr_strdata_pioinit(SDAT, compid ) + use shr_pio_mod, only: shr_pio_getiosys, shr_pio_getiotype, shr_pio_getioformat type(shr_strdata_type),intent(inout):: SDAT ! strdata data data-type type(iosystem_desc_t), pointer :: io_subsystem - integer, intent(in) :: io_type + integer, intent(in) :: compid - SDAT%pio_subsystem => io_subsystem - SDAT%io_type=io_type + SDAT%pio_subsystem => shr_pio_getiosys(compid) + SDAT%io_type=shr_pio_getiotype(compid) + SDAT%io_format = shr_pio_getioformat(compid) end subroutine shr_strdata_pioinit @@ -1329,7 +1333,6 @@ subroutine shr_strdata_create(SDAT, name, mpicom, compid, gsmap, ggrid, nxg, nyg domFilePath, domFileName, & domTvarName, domXvarName, domYvarName, domAreaName, domMaskName, & filePath, filename, fldListFile, fldListModel, & - pio_subsystem, pio_iotype, & !--- strdata optional --- nzg, domZvarName, & taxMode, dtlimit, tintalgo, readmode, & @@ -1365,9 +1368,6 @@ subroutine shr_strdata_create(SDAT, name, mpicom, compid, gsmap, ggrid, nxg, nyg character(*) ,intent(in) :: filename(:) ! filename for index filenumber character(*) ,intent(in) :: fldListFile ! file field names, colon delim list character(*) ,intent(in) :: fldListModel ! model field names, colon delim list - type(iosystem_desc_t), pointer :: pio_subsystem ! PIO subsystem pointer - integer(IN) , intent(in) :: pio_iotype ! PIO file type - integer(IN) ,optional ,intent(in) :: nzg character(*),optional ,intent(in) :: domZvarName ! domain z dim name character(*),optional ,intent(in) :: taxMode @@ -1399,7 +1399,7 @@ subroutine shr_strdata_create(SDAT, name, mpicom, compid, gsmap, ggrid, nxg, nyg SDAT%nstreams = 1 - call shr_strdata_pioinit(sdat, pio_subsystem, pio_iotype) + call shr_strdata_pioinit(sdat, compid) if (present(taxMode)) then SDAT%taxMode(1) = taxMode @@ -1649,4 +1649,3 @@ end subroutine shr_strdata_setlogunit !=============================================================================== end module shr_strdata_mod - From e633021e8c9965d938730731174f64f3f50fdd9b Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Mon, 31 Jul 2017 15:59:59 -0600 Subject: [PATCH 02/16] add interfaces for backward compatibility --- src/share/util/shr_strdata_mod.F90 | 105 +++++++++++++++++++++++++++-- 1 file changed, 101 insertions(+), 4 deletions(-) diff --git a/src/share/util/shr_strdata_mod.F90 b/src/share/util/shr_strdata_mod.F90 index f4cb03080a7..e448bf23bc3 100644 --- a/src/share/util/shr_strdata_mod.F90 +++ b/src/share/util/shr_strdata_mod.F90 @@ -66,6 +66,17 @@ module shr_strdata_mod public shr_strdata_setlogunit public shr_strdata_pioinit +!! Interface + + interface shr_strdata_pioinit + module procedure shr_strdata_pioinit_oldway + module procedure shr_strdata_pioinit_newway + end interface shr_strdata_pioinit + + interface shr_strdata_create + module procedure shr_strdata_create_oldway + module procedure shr_strdata_create_newway + end interface shr_strdata_create ! !PUBLIC DATA MEMBERS: @@ -1300,7 +1311,7 @@ end subroutine shr_strdata_readnml ! 2010-10-26 Jim Edwards ! ! !INTERFACE: ------------------------------------------------------------------ -subroutine shr_strdata_pioinit(SDAT, compid ) +subroutine shr_strdata_pioinit_newway(SDAT, compid ) use shr_pio_mod, only: shr_pio_getiosys, shr_pio_getiotype, shr_pio_getioformat type(shr_strdata_type),intent(inout):: SDAT ! strdata data data-type type(iosystem_desc_t), pointer :: io_subsystem @@ -1310,7 +1321,20 @@ subroutine shr_strdata_pioinit(SDAT, compid ) SDAT%io_type=shr_pio_getiotype(compid) SDAT%io_format = shr_pio_getioformat(compid) -end subroutine shr_strdata_pioinit +end subroutine shr_strdata_pioinit_newway + +subroutine shr_strdata_pioinit_oldway(SDAT,io_subsystem, io_type ) + type(shr_strdata_type),intent(inout):: SDAT ! strdata data data-type + type(iosystem_desc_t), pointer :: io_subsystem + integer, intent(in) :: io_type + + SDAT%pio_subsystem => io_subsystem + SDAT%io_type=io_type + SDAT%io_format = PIO_64BIT_OFFSET ! hardcoded + +end subroutine shr_strdata_pioinit_oldway + + !=============================================================================== !BOP =========================================================================== @@ -1327,7 +1351,7 @@ end subroutine shr_strdata_pioinit ! 2009-Apr-16 - T. Craig - add minimal parallel support ! ! !INTERFACE: ------------------------------------------------------------------ -subroutine shr_strdata_create(SDAT, name, mpicom, compid, gsmap, ggrid, nxg, nyg, & +subroutine shr_strdata_create_newway(SDAT, name, mpicom, compid, gsmap, ggrid, nxg, nyg, & !--- streams stuff required --- yearFirst, yearLast, yearAlign, offset, & domFilePath, domFileName, & @@ -1469,8 +1493,81 @@ subroutine shr_strdata_create(SDAT, name, mpicom, compid, gsmap, ggrid, nxg, nyg gsmap=gsmap, ggrid=ggrid, nxg=nxg, nyg=nyg, nzg=1) endif -end subroutine shr_strdata_create +end subroutine shr_strdata_create_newway + +subroutine shr_strdata_create_oldway(SDAT, name, mpicom, compid, gsmap, ggrid, nxg, nyg, & +!--- streams stuff required --- + yearFirst, yearLast, yearAlign, offset, & + domFilePath, domFileName, & + domTvarName, domXvarName, domYvarName, domAreaName, domMaskName, & + filePath, filename, fldListFile, fldListModel, & + pio_subsystem, pio_iotype, & +!--- strdata optional --- + nzg, domZvarName, & + taxMode, dtlimit, tintalgo, readmode, & + fillalgo, fillmask, fillread, fillwrite, & + mapalgo, mapmask, mapread, mapwrite, & + calendar) + + implicit none + +! !INPUT/OUTPUT PARAMETERS: + + type(shr_strdata_type),intent(inout):: SDAT ! strdata data data-type + character(*) ,intent(in) :: name ! name of strdata + integer(IN) ,intent(in) :: mpicom ! mpi comm + integer(IN) ,intent(in) :: compid + type(mct_gsmap) ,intent(in) :: gsmap + type(mct_ggrid) ,intent(in) :: ggrid + integer(IN) ,intent(in) :: nxg + integer(IN) ,intent(in) :: nyg + + integer(IN) ,intent(in) :: yearFirst ! first year to use + integer(IN) ,intent(in) :: yearLast ! last year to use + integer(IN) ,intent(in) :: yearAlign ! align yearFirst with this model year + integer(IN) ,intent(in) :: offset ! offset in seconds of stream data + character(*) ,intent(in) :: domFilePath ! domain file path + character(*) ,intent(in) :: domFileName ! domain file name + character(*) ,intent(in) :: domTvarName ! domain time dim name + character(*) ,intent(in) :: domXvarName ! domain x dim name + character(*) ,intent(in) :: domYvarName ! domain y dim name + character(*) ,intent(in) :: domAreaName ! domain area name + character(*) ,intent(in) :: domMaskName ! domain mask name + character(*) ,intent(in) :: filePath ! path to filenames + character(*) ,intent(in) :: filename(:) ! filename for index filenumber + character(*) ,intent(in) :: fldListFile ! file field names, colon delim list + character(*) ,intent(in) :: fldListModel ! model field names, colon delim list + type(iosystem_desc_t), pointer :: pio_subsystem ! PIO subsystem pointer + integer(IN) , intent(in) :: pio_iotype ! PIO file type + + integer(IN) ,optional ,intent(in) :: nzg + character(*),optional ,intent(in) :: domZvarName ! domain z dim name + character(*),optional ,intent(in) :: taxMode + real(R8) ,optional ,intent(in) :: dtlimit + character(*),optional ,intent(in) :: fillalgo ! fill algorithm + character(*),optional ,intent(in) :: fillmask ! fill mask + character(*),optional ,intent(in) :: fillread ! fill mapping file to read + character(*),optional ,intent(in) :: fillwrite ! fill mapping file to write + character(*),optional ,intent(in) :: mapalgo ! scalar map algorithm + character(*),optional ,intent(in) :: mapmask ! scalar map mask + character(*),optional ,intent(in) :: mapread ! regrid mapping file to read + character(*),optional ,intent(in) :: mapwrite ! regrid mapping file to write + character(*),optional ,intent(in) :: tintalgo ! time interpolation algorithm + character(*),optional ,intent(in) :: readmode ! file read mode + character(*),optional, intent(in) :: calendar + +!EOP + ! pio variables are already in SDAT no need to copy them + call shr_strdata_create_newway(SDAT, name, mpicom, compid, gsmap, ggrid, nxg, nyg,& + yearFirst, yearLast, yearAlign, offset, domFilePath, domFilename, domTvarName, & + domXvarName, domYvarName, domAreaName, domMaskName, & + filePath, filename, fldListFile, fldListModel, nzg=nzg, domZvarName=domZvarName,& + taxMode=taxMode,dtlimit=dtlimit,tintalgo=tintalgo,readmode=readmode,& + fillalgo=fillalgo,fillmask=fillmask,fillread=fillread,fillwrite=fillwrite,mapalgo=mapalgo,& + mapmask=mapmask,mapread=mapread,mapwrite=mapwrite,calendar=calendar) + + end subroutine shr_strdata_create_oldway !=============================================================================== !BOP =========================================================================== ! From f97b2b98629588f998796d0c31da34f209dad9e6 Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Mon, 31 Jul 2017 16:09:28 -0600 Subject: [PATCH 03/16] unrelated option for cori-knl --- config/cesm/machines/config_batch.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/config/cesm/machines/config_batch.xml b/config/cesm/machines/config_batch.xml index a2f841c2730..ece44ef45f0 100644 --- a/config/cesm/machines/config_batch.xml +++ b/config/cesm/machines/config_batch.xml @@ -397,6 +397,7 @@ sbatch -C knl,quad,cache + -S 2 regular From f0eae5a82dfad7e81cfbc274030bde19c20ccbd4 Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Tue, 1 Aug 2017 06:38:47 -0600 Subject: [PATCH 04/16] remove unused var --- src/drivers/mct/main/seq_rest_mod.F90 | 1 - 1 file changed, 1 deletion(-) diff --git a/src/drivers/mct/main/seq_rest_mod.F90 b/src/drivers/mct/main/seq_rest_mod.F90 index 561034eab97..4c364534b65 100644 --- a/src/drivers/mct/main/seq_rest_mod.F90 +++ b/src/drivers/mct/main/seq_rest_mod.F90 @@ -317,7 +317,6 @@ subroutine seq_rest_write(EClock_d, seq_SyncClock, infodata, & integer(IN) :: ivar ! integer variable real(r8) :: rvar ! real variable logical :: whead,wdata ! flags header/data writing - logical :: cdf64 ! true => create netCDF with 64 bit addressing logical :: cplroot ! root pe on cpl id integer(IN) :: iun ! unit number character(CL) :: rest_file ! Local path to restart filename From d97f22dcca6808b3a616bc23136905c49cdd3d4e Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Tue, 1 Aug 2017 07:12:04 -0600 Subject: [PATCH 05/16] initialize variable --- src/share/util/shr_pio_mod.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/share/util/shr_pio_mod.F90 b/src/share/util/shr_pio_mod.F90 index 75818ab9c23..7ee265d7380 100644 --- a/src/share/util/shr_pio_mod.F90 +++ b/src/share/util/shr_pio_mod.F90 @@ -95,7 +95,7 @@ subroutine shr_pio_init1(ncomps, nlfilename, Global_Comm) call shr_pio_read_default_namelist(nlfilename, Global_Comm, pio_stride, pio_root, pio_numiotasks, & pio_iotype, pio_async_interface, pio_rearranger) - + pio_netcdf_ioformat = PIO_64BIT_OFFSET call MPI_comm_rank(Global_Comm, drank, ierr) io_comm = MPI_COMM_NULL From 9f7ddf49c7749f01c06b99153d62297c0f2a61d5 Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Tue, 1 Aug 2017 07:56:56 -0600 Subject: [PATCH 06/16] initialize variable --- src/share/util/shr_pio_mod.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/share/util/shr_pio_mod.F90 b/src/share/util/shr_pio_mod.F90 index 75818ab9c23..7ee265d7380 100644 --- a/src/share/util/shr_pio_mod.F90 +++ b/src/share/util/shr_pio_mod.F90 @@ -95,7 +95,7 @@ subroutine shr_pio_init1(ncomps, nlfilename, Global_Comm) call shr_pio_read_default_namelist(nlfilename, Global_Comm, pio_stride, pio_root, pio_numiotasks, & pio_iotype, pio_async_interface, pio_rearranger) - + pio_netcdf_ioformat = PIO_64BIT_OFFSET call MPI_comm_rank(Global_Comm, drank, ierr) io_comm = MPI_COMM_NULL From 02c357bd085c6ce0b713596828be13fd98a820c7 Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Tue, 1 Aug 2017 09:00:04 -0600 Subject: [PATCH 07/16] missed some changes in docn --- src/components/data_comps/docn/docn_comp_mod.F90 | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/components/data_comps/docn/docn_comp_mod.F90 b/src/components/data_comps/docn/docn_comp_mod.F90 index f104df22aca..5b5634c1722 100644 --- a/src/components/data_comps/docn/docn_comp_mod.F90 +++ b/src/components/data_comps/docn/docn_comp_mod.F90 @@ -17,7 +17,6 @@ module docn_comp_mod use mct_mod use esmf use perf_mod - use pio, only : iosystem_desc_t, pio_init, pio_rearr_box use shr_strdata_mod use shr_dmodel_mod @@ -47,7 +46,6 @@ module docn_comp_mod !-------------------------------------------------------------------------- !--- other --- - type(iosystem_desc_t), pointer :: iosystem character(CS) :: myModelName = 'ocn' ! user defined model name integer(IN) :: mpicom integer(IN) :: my_task ! my task in mpi communicator mpicom @@ -815,8 +813,9 @@ subroutine docn_comp_run( EClock, cdata, x2o, o2x) endif if (trim(ocn_mode) == 'SOM' .or. trim(ocn_mode) == 'SOM_AQUAP') then if (my_task == master_task) write(logunit,F04) ' writing ',trim(rest_file),currentYMD,currentTOD - call shr_pcdf_readwrite('write',iosystem,SDOCN%io_type,trim(rest_file),mpicom,gsmap,clobber=.true., & - rf1=somtp,rf1n='somtp') + call shr_pcdf_readwrite('write',SDOCN%pio_subsystem,SDOCN%io_type,trim(rest_file),& + mpicom,gsmap=gsmap,clobber=.true., & + rf1=somtp,rf1n='somtp', io_format=SDOCN%io_format) endif if (my_task == master_task) write(logunit,F04) ' writing ',trim(rest_file_strm),currentYMD,currentTOD call shr_strdata_restWrite(trim(rest_file_strm),SDOCN,mpicom,trim(case_name),'SDOCN strdata') From edad962242a60a85ca3d483a8edca0e969d27930 Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Sat, 29 Jul 2017 07:00:11 -0600 Subject: [PATCH 08/16] dont use Machines object to get DIN_LOC_ROOT --- scripts/Tools/check_input_data | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/scripts/Tools/check_input_data b/scripts/Tools/check_input_data index 78e673d4123..5164a048020 100755 --- a/scripts/Tools/check_input_data +++ b/scripts/Tools/check_input_data @@ -7,15 +7,12 @@ Should be run from case. """ from standard_script_setup import * -from CIME.utils import get_model -from CIME.XML.machines import Machines +from CIME.utils import get_model, run_cmd_no_fail 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): ############################################################################### @@ -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"))) + din_loc_root = run_cmd_no_fail("./xmlquery --value DIN_LOC_ROOT") + + parser.add_argument("-i", "--input-data-root", default=din_loc_root, + help="The root directory where input data goes. ") + parser.add_argument("--data-list-dir", default="Buildconf", help="Where to find list of input files") From 62f9b3661856ccb4a85e2d10ecab57485be91fa6 Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Sat, 29 Jul 2017 07:52:59 -0600 Subject: [PATCH 09/16] fix format of error message --- src/drivers/mct/main/component_type_mod.F90 | 2 +- .../mct/unit_test/check_fields_test/test_check_fields.pf | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/drivers/mct/main/component_type_mod.F90 b/src/drivers/mct/main/component_type_mod.F90 index bf0395b211a..50bad3c021e 100644 --- a/src/drivers/mct/main/component_type_mod.F90 +++ b/src/drivers/mct/main/component_type_mod.F90 @@ -252,7 +252,7 @@ subroutine check_fields(comp, comp_index) if(shr_infnan_isnan(comp%c2x_cc%rattr(fld,n))) then call mpi_comm_rank(comp%mpicom_compid, rank, ierr) call mct_gsMap_orderedPoints(comp%gsmap_cc, rank, gpts) - write(msg,*)'component_mod:check_fields NaN found in ',trim(comp%name),' instance: ',& + write(msg,'(a,a,a,i4,a,a,a,i8)')'component_mod:check_fields NaN found in ',trim(comp%name),' instance: ',& comp_index,' field ',trim(mct_avect_getRList2c(fld, comp%c2x_cc)), ' 1d global index: ',gpts(n) call shr_sys_abort(msg) endif diff --git a/src/drivers/mct/unit_test/check_fields_test/test_check_fields.pf b/src/drivers/mct/unit_test/check_fields_test/test_check_fields.pf index ab304e6fc64..772d22ec0d5 100644 --- a/src/drivers/mct/unit_test/check_fields_test/test_check_fields.pf +++ b/src/drivers/mct/unit_test/check_fields_test/test_check_fields.pf @@ -59,7 +59,7 @@ contains call create_gsmap(this%comp%gsmap_cc, lsize) call check_fields(this%comp, 1) - @assertExceptionRaised('ABORTED: component_mod:check_fields NaN found in pfunittest instance: 1 field foo 1d global index: 3') + @assertExceptionRaised('ABORTED: component_mod:check_fields NaN found in pfunittest instance: 1 field foo 1d global index: 3') end subroutine createAVectWithoutData_1Field_checkField @@ -93,7 +93,7 @@ contains call check_fields(this%comp, 1) - @assertExceptionRaised('ABORTED: component_mod:check_fields NaN found in pfunittest instance: 1 field foo2 1d global index: 3') + @assertExceptionRaised('ABORTED: component_mod:check_fields NaN found in pfunittest instance: 1 field foo2 1d global index: 3') end subroutine createAVectWithoutData_3Field_checkFields end module test_check_fields From c6b34aa7880871ef75efb02efa51db86e1a2f0af Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Sat, 29 Jul 2017 07:54:19 -0600 Subject: [PATCH 10/16] fix pylint issue --- scripts/Tools/case.qstatus | 3 --- 1 file changed, 3 deletions(-) diff --git a/scripts/Tools/case.qstatus b/scripts/Tools/case.qstatus index 9c8ccc745eb..9d64209e14e 100755 --- a/scripts/Tools/case.qstatus +++ b/scripts/Tools/case.qstatus @@ -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 * ############################################################################### From 3f2ffb87fc98a2369d03455136fa2e6b6705c810 Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Sat, 29 Jul 2017 08:39:50 -0600 Subject: [PATCH 11/16] one more pylint fix --- scripts/lib/CIME/XML/env_batch.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/lib/CIME/XML/env_batch.py b/scripts/lib/CIME/XML/env_batch.py index 1e0568d5eb9..ef814794ca1 100644 --- a/scripts/lib/CIME/XML/env_batch.py +++ b/scripts/lib/CIME/XML/env_batch.py @@ -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() From f6fb2614fd573e05295ba2c9b81d44e092d1f79d Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Mon, 31 Jul 2017 17:47:57 -0600 Subject: [PATCH 12/16] remove xmlquery from help message --- scripts/Tools/check_input_data | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/scripts/Tools/check_input_data b/scripts/Tools/check_input_data index 5164a048020..3140b639fad 100755 --- a/scripts/Tools/check_input_data +++ b/scripts/Tools/check_input_data @@ -7,7 +7,7 @@ Should be run from case. """ from standard_script_setup import * -from CIME.utils import get_model, run_cmd_no_fail +from CIME.utils import get_model from CIME.check_input_data import check_input_data, SVN_LOCS from CIME.case import Case @@ -38,10 +38,9 @@ formatter_class=argparse.ArgumentDefaultsHelpFormatter parser.add_argument("--svn-loc", default=SVN_LOCS[get_model()], help="The input data repository from which to download data.") - din_loc_root = run_cmd_no_fail("./xmlquery --value DIN_LOC_ROOT") - parser.add_argument("-i", "--input-data-root", default=din_loc_root, - help="The root directory where input data goes. ") + parser.add_argument("-i", "--input-data-root",default="xmlquery DIN_LOC_ROOT", + help="The root directory where input data goes.") parser.add_argument("--data-list-dir", default="Buildconf", From 0584f884f86ae5d3eb834a43074b9ef54442033f Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Tue, 1 Aug 2017 10:43:20 -0600 Subject: [PATCH 13/16] update help message --- scripts/Tools/check_input_data | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/Tools/check_input_data b/scripts/Tools/check_input_data index 3140b639fad..811920ade56 100755 --- a/scripts/Tools/check_input_data +++ b/scripts/Tools/check_input_data @@ -39,8 +39,9 @@ formatter_class=argparse.ArgumentDefaultsHelpFormatter help="The input data repository from which to download data.") - parser.add_argument("-i", "--input-data-root",default="xmlquery DIN_LOC_ROOT", - help="The root directory where input data goes.") + 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", From 62e230f67d0c7f27efaf6b35b1f7c9627c0ae4a5 Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Tue, 1 Aug 2017 10:50:48 -0600 Subject: [PATCH 14/16] pio_64bit_data not defined unless pnetcdf is --- src/share/util/shr_pio_mod.F90 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/share/util/shr_pio_mod.F90 b/src/share/util/shr_pio_mod.F90 index 7ee265d7380..8b2aaeb0c7c 100644 --- a/src/share/util/shr_pio_mod.F90 +++ b/src/share/util/shr_pio_mod.F90 @@ -610,8 +610,10 @@ subroutine shr_pio_getioformatfromname(pio_netcdf_format, pio_netcdf_ioformat, p pio_netcdf_ioformat = 0 elseif ( pio_netcdf_format .eq. '64BIT_OFFSET' ) then pio_netcdf_ioformat = PIO_64BIT_OFFSET +#ifdef _PNETCDF elseif ( pio_netcdf_format .eq. '64BIT_DATA' ) then pio_netcdf_ioformat = PIO_64BIT_DATA +#endif else pio_netcdf_ioformat = pio_default_netcdf_ioformat endif From 134e51379cbbe4531e5727220b665e0f95e38a51 Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Tue, 1 Aug 2017 12:26:04 -0600 Subject: [PATCH 15/16] fix xsd error --- config/xml_schemas/env_mach_specific.xsd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/xml_schemas/env_mach_specific.xsd b/config/xml_schemas/env_mach_specific.xsd index 2ea8a90ee7b..45a4ddfc656 100644 --- a/config/xml_schemas/env_mach_specific.xsd +++ b/config/xml_schemas/env_mach_specific.xsd @@ -4,7 +4,7 @@ - + From cdb45b4e5fb69aedfafe4eb8022bd71aed64785f Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Tue, 1 Aug 2017 14:43:04 -0600 Subject: [PATCH 16/16] remove unrelated change --- config/cesm/machines/config_batch.xml | 1 - config/xml_schemas/env_mach_specific.xsd | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/config/cesm/machines/config_batch.xml b/config/cesm/machines/config_batch.xml index ece44ef45f0..a2f841c2730 100644 --- a/config/cesm/machines/config_batch.xml +++ b/config/cesm/machines/config_batch.xml @@ -397,7 +397,6 @@ sbatch -C knl,quad,cache - -S 2 regular diff --git a/config/xml_schemas/env_mach_specific.xsd b/config/xml_schemas/env_mach_specific.xsd index 45a4ddfc656..2ea8a90ee7b 100644 --- a/config/xml_schemas/env_mach_specific.xsd +++ b/config/xml_schemas/env_mach_specific.xsd @@ -4,7 +4,7 @@ - +