Skip to content

Commit 9ecb736

Browse files
peverwheeSteve Goldhaber
authored andcommitted
ESCOMP tag: cam6_3_140
Merge pull request ESCOMP#903 from peverwhee/history-split cam6_3_140: Separate history tapes into hXi and hXa ESCOMP commit: 32f2772
1 parent d630a63 commit 9ecb736

7 files changed

Lines changed: 1866 additions & 1263 deletions

File tree

cime_config/SystemTests/sct.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def _case_two_setup(self):
4343
append_to_user_nl_files(caseroot = self._get_caseroot(), component = "cam", contents = "MFILT = 1,7,1,1,1,1")
4444
append_to_user_nl_files(caseroot = self._get_caseroot(), component = "cam", contents = "nhtfrq = 1,1,1,1,1,1")
4545
append_to_user_nl_files(caseroot = self._get_caseroot(), component = "cam", contents = "fincl2='T','Q','TDIFF','QDIFF','LANDFRAC'")
46-
append_to_user_nl_files(caseroot = self._get_caseroot(), component = "cam", contents = "iopfile = '../"+case_name+".cam.h1."+RUN_STARTDATE+"-00000.nc'")
46+
append_to_user_nl_files(caseroot = self._get_caseroot(), component = "cam", contents = "iopfile = '../"+case_name+".cam.h1i."+RUN_STARTDATE+"-00000.nc'")
4747
append_to_user_nl_files(caseroot = self._get_caseroot(), component = "cam", contents = "inithist = 'YEARLY'")
4848
append_to_user_nl_files(caseroot = self._get_caseroot(), component = "cam", contents = "scm_cambfb_mode = .true.")
4949
append_to_user_nl_files(caseroot = self._get_caseroot(), component = "cam", contents = "scm_use_obs_uv = .true.")
@@ -65,7 +65,7 @@ def _component_compare_test(self, suffix1, suffix2,
6565
success_change=False,
6666
ignore_fieldlist_diffs=False):
6767
with self._test_status:
68-
stat,netcdf_filename,err=run_cmd('ls ./run/case2run/*h1*8400.nc ')
68+
stat,netcdf_filename,err=run_cmd('ls ./run/case2run/*h1i*8400.nc ')
6969
stat,DIFFs,err=run_cmd('ncdump -ff -p 9,17 -v QDIFF,TDIFF '+netcdf_filename+' | egrep //\.\*DIFF | sed s/^\ \*// | sed s/^0,/0.0,/ | sed s/^0\;/0.0\;/ | sed s/\[,\;\].\*// | uniq')
7070
array_of_DIFFs=DIFFs.split("\n")
7171
answer=max([abs(float(x)) for x in array_of_DIFFs])

doc/ChangeLog

Lines changed: 275 additions & 0 deletions
Large diffs are not rendered by default.

src/control/cam_history.F90

Lines changed: 1374 additions & 1147 deletions
Large diffs are not rendered by default.

src/control/cam_history_support.F90

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ module cam_history_support
1515
use cam_logfile, only: iulog
1616
use spmd_utils, only: masterproc
1717
use cam_grid_support, only: cam_grid_patch_t, cam_grid_header_info_t
18-
use cam_grid_support, only: max_hcoordname_len
18+
use cam_grid_support, only: max_hcoordname_len, maxsplitfiles
1919
use cam_pio_utils, only: cam_pio_handle_error
2020

2121
implicit none
@@ -197,7 +197,7 @@ module cam_history_support
197197
! PIO ids
198198
!
199199

200-
type(file_desc_t) :: File ! PIO file id
200+
type(file_desc_t) :: Files(maxsplitfiles) ! PIO file ids
201201

202202
type(var_desc_t) :: mdtid ! var id for timestep
203203
type(var_desc_t) :: ndbaseid ! var id for base day
@@ -220,7 +220,7 @@ module cam_history_support
220220
#endif
221221
type(var_desc_t) :: nstephid ! var id for current timestep
222222
type(var_desc_t) :: timeid ! var id for time
223-
type(var_desc_t) :: tbndid ! var id for time_bnds
223+
type(var_desc_t) :: tbndid ! var id for time_bounds
224224
type(var_desc_t) :: date_writtenid ! var id for date time sample written
225225
type(var_desc_t) :: time_writtenid ! var id for time time sample written
226226
type(var_desc_t) :: f107id ! var id for f107

src/control/filenames.F90

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ end function get_dir
4848
!===============================================================================
4949

5050
character(len=cl) function interpret_filename_spec( filename_spec, number, prev, case, &
51-
yr_spec, mon_spec, day_spec, sec_spec )
51+
yr_spec, mon_spec, day_spec, sec_spec, flag_spec )
5252

5353
! Create a filename from a filename specifier. The
5454
! filename specifyer includes codes for setting things such as the
@@ -77,12 +77,14 @@ end function get_dir
7777
integer , intent(in), optional :: mon_spec ! Simulation month
7878
integer , intent(in), optional :: day_spec ! Simulation day
7979
integer , intent(in), optional :: sec_spec ! Seconds into current simulation day
80+
character(len=*), intent(in), optional :: flag_spec ! flag for accumulated or instantaneous
8081

8182
! Local variables
8283
integer :: year ! Simulation year
8384
integer :: month ! Simulation month
8485
integer :: day ! Simulation day
8586
integer :: ncsec ! Seconds into current simulation day
87+
character(len=1) :: flag
8688
character(len=cl) :: string ! Temporary character string
8789
character(len=cl) :: format ! Format character string
8890
integer :: i, n ! Loop variables
@@ -116,6 +118,11 @@ end function get_dir
116118
call get_curr_date(year, month, day, ncsec)
117119
end if
118120
end if
121+
if (present(flag_spec)) then
122+
flag = flag_spec
123+
else
124+
flag = ''
125+
end if
119126
!
120127
! Go through each character in the filename specifyer and interpret if special string
121128
!
@@ -170,6 +177,8 @@ end function get_dir
170177
write(string,'(i2.2)') day
171178
case( 's' ) ! second
172179
write(string,'(i5.5)') ncsec
180+
case( 'f' ) ! flag
181+
write(string,'(a)') flag
173182
case( '%' ) ! percent character
174183
string = "%"
175184
case default

src/control/sat_hist.F90

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -466,53 +466,53 @@ subroutine sat_hist_write( tape , nflds, nfils)
466466
call get_indices( obs_lats, obs_lons, ncols, nocols, has_dyn_flds, col_ndxs, chk_ndxs, &
467467
fdyn_ndxs, ldyn_ndxs, phs_owners, dyn_owners, mlats, mlons, phs_dists )
468468

469-
if ( .not. pio_file_is_open(tape%File) ) then
469+
if ( .not. pio_file_is_open(tape%Files(1)) ) then
470470
call endrun('sat file not open')
471471
endif
472472

473473

474-
ierr = pio_inq_dimid(tape%File,'ncol',coldim )
474+
ierr = pio_inq_dimid(tape%Files(1),'ncol',coldim )
475475

476-
ierr = pio_inq_varid(tape%File, 'lat', out_latid )
477-
ierr = pio_inq_varid(tape%File, 'lon', out_lonid )
478-
ierr = pio_inq_varid(tape%File, 'distance', out_dstid )
476+
ierr = pio_inq_varid(tape%Files(1), 'lat', out_latid )
477+
ierr = pio_inq_varid(tape%Files(1), 'lon', out_lonid )
478+
ierr = pio_inq_varid(tape%Files(1), 'distance', out_dstid )
479479

480480
call write_record_coord( tape, mlats(:), mlons(:), phs_dists(:), ncols, nfils )
481481

482482
! dump columns of 2D fields
483483
if (has_phys_srf_flds) then
484-
call dump_columns( tape%File, tape%hlist, nflds, nocols, 1, nfils, &
484+
call dump_columns( tape%Files(1), tape%hlist, nflds, nocols, 1, nfils, &
485485
col_ndxs, chk_ndxs, phs_owners, phys_decomp )
486486
endif
487487
if (has_dyn_srf_flds) then
488-
call dump_columns( tape%File, tape%hlist, nflds, nocols, 1, nfils, &
488+
call dump_columns( tape%Files(1), tape%hlist, nflds, nocols, 1, nfils, &
489489
fdyn_ndxs, ldyn_ndxs, dyn_owners, dyn_decomp )
490490
endif
491491

492492
! dump columns of 3D fields defined on mid pres levels
493493
if (has_phys_lev_flds) then
494-
call dump_columns( tape%File, tape%hlist, nflds, nocols, pver, nfils, &
494+
call dump_columns( tape%Files(1), tape%hlist, nflds, nocols, pver, nfils, &
495495
col_ndxs, chk_ndxs, phs_owners, phys_decomp )
496496
endif
497497
if (has_dyn_lev_flds) then
498-
call dump_columns( tape%File, tape%hlist, nflds, nocols, pver, nfils, &
498+
call dump_columns( tape%Files(1), tape%hlist, nflds, nocols, pver, nfils, &
499499
fdyn_ndxs, ldyn_ndxs, dyn_owners, dyn_decomp )
500500
endif
501501

502502
! dump columns of 3D fields defined on interface pres levels
503503
if (has_phys_ilev_flds) then
504-
call dump_columns( tape%File, tape%hlist, nflds, nocols, pverp, nfils, &
504+
call dump_columns( tape%Files(1), tape%hlist, nflds, nocols, pverp, nfils, &
505505
col_ndxs, chk_ndxs, phs_owners, phys_decomp )
506506
endif
507507
if (has_dyn_ilev_flds) then
508-
call dump_columns( tape%File, tape%hlist, nflds, nocols, pverp, nfils, &
508+
call dump_columns( tape%Files(1), tape%hlist, nflds, nocols, pverp, nfils, &
509509
fdyn_ndxs, ldyn_ndxs, dyn_owners, dyn_decomp )
510510
endif
511511

512512
deallocate( col_ndxs, chk_ndxs, fdyn_ndxs, ldyn_ndxs, phs_owners, dyn_owners )
513513
deallocate( mlons, mlats, phs_dists )
514514
deallocate( obs_lons, obs_lats )
515-
call pio_syncfile(tape%File)
515+
call pio_syncfile(tape%Files(1))
516516

517517
nfils = nfils + nocols
518518

@@ -763,19 +763,19 @@ subroutine write_record_coord( tape, mod_lats, mod_lons, mod_dists, ncols, nfils
763763
allocate( rtmp(ncols * sathist_nclosest) )
764764

765765
itmp(:) = ncdate
766-
ierr = pio_put_var(tape%File, tape%dateid,(/nfils/), (/ncols * sathist_nclosest/),itmp)
766+
ierr = pio_put_var(tape%Files(1), tape%dateid,(/nfils/), (/ncols * sathist_nclosest/),itmp)
767767
itmp(:) = ncsec
768-
ierr = pio_put_var(tape%File, tape%datesecid,(/nfils/),(/ncols * sathist_nclosest/),itmp)
768+
ierr = pio_put_var(tape%Files(1), tape%datesecid,(/nfils/),(/ncols * sathist_nclosest/),itmp)
769769
rtmp(:) = time
770-
ierr = pio_put_var(tape%File, tape%timeid, (/nfils/),(/ncols * sathist_nclosest/),rtmp)
770+
ierr = pio_put_var(tape%Files(1), tape%timeid, (/nfils/),(/ncols * sathist_nclosest/),rtmp)
771771

772772
deallocate(itmp)
773773
deallocate(rtmp)
774774

775775
! output model column coordinates
776-
ierr = pio_put_var(tape%File, out_latid, (/nfils/),(/ncols * sathist_nclosest/), mod_lats)
777-
ierr = pio_put_var(tape%File, out_lonid, (/nfils/),(/ncols * sathist_nclosest/), mod_lons)
778-
ierr = pio_put_var(tape%File, out_dstid, (/nfils/),(/ncols * sathist_nclosest/), mod_dists / 1000._r8)
776+
ierr = pio_put_var(tape%Files(1), out_latid, (/nfils/),(/ncols * sathist_nclosest/), mod_lats)
777+
ierr = pio_put_var(tape%Files(1), out_lonid, (/nfils/),(/ncols * sathist_nclosest/), mod_lons)
778+
ierr = pio_put_var(tape%Files(1), out_dstid, (/nfils/),(/ncols * sathist_nclosest/), mod_dists / 1000._r8)
779779

780780
! output instrument location
781781
allocate( out_lats(ncols * sathist_nclosest) )
@@ -786,40 +786,40 @@ subroutine write_record_coord( tape, mod_lats, mod_lons, mod_dists, ncols, nfils
786786
out_lons(((i-1)*sathist_nclosest)+1 : (i*sathist_nclosest)) = obs_lons(i)
787787
enddo
788788

789-
ierr = pio_put_var(tape%File, out_instr_lat_vid, (/nfils/),(/ncols * sathist_nclosest/), out_lats)
790-
ierr = pio_put_var(tape%File, out_instr_lon_vid, (/nfils/),(/ncols * sathist_nclosest/), out_lons)
789+
ierr = pio_put_var(tape%Files(1), out_instr_lat_vid, (/nfils/),(/ncols * sathist_nclosest/), out_lats)
790+
ierr = pio_put_var(tape%Files(1), out_instr_lon_vid, (/nfils/),(/ncols * sathist_nclosest/), out_lons)
791791

792792
deallocate(out_lats)
793793
deallocate(out_lons)
794794

795795

796-
ierr = copy_data( infile, date_vid, tape%File, out_obs_date_vid, in_start_col, nfils, ncols )
797-
ierr = copy_data( infile, time_vid, tape%File, out_obs_time_vid, in_start_col, nfils, ncols )
796+
ierr = copy_data( infile, date_vid, tape%Files(1), out_obs_date_vid, in_start_col, nfils, ncols )
797+
ierr = copy_data( infile, time_vid, tape%Files(1), out_obs_time_vid, in_start_col, nfils, ncols )
798798

799799
! output observation identifiers
800800
if (instr_vid>0) then
801-
ierr = copy_data( infile, instr_vid, tape%File, out_instrid, in_start_col, nfils, ncols )
801+
ierr = copy_data( infile, instr_vid, tape%Files(1), out_instrid, in_start_col, nfils, ncols )
802802
endif
803803
if (orbit_vid>0) then
804-
ierr = copy_data( infile, orbit_vid, tape%File, out_orbid, in_start_col, nfils, ncols )
804+
ierr = copy_data( infile, orbit_vid, tape%Files(1), out_orbid, in_start_col, nfils, ncols )
805805
endif
806806
if (prof_vid>0) then
807-
ierr = copy_data( infile, prof_vid, tape%File, out_profid, in_start_col, nfils, ncols )
807+
ierr = copy_data( infile, prof_vid, tape%Files(1), out_profid, in_start_col, nfils, ncols )
808808
endif
809809
if (zenith_vid>0) then
810-
ierr = copy_data( infile, zenith_vid, tape%File, out_zenithid, in_start_col, nfils, ncols )
810+
ierr = copy_data( infile, zenith_vid, tape%Files(1), out_zenithid, in_start_col, nfils, ncols )
811811
endif
812812
if (in_julian_vid>0) then
813-
ierr = copy_data( infile, in_julian_vid, tape%File, out_julian_vid, in_start_col, nfils, ncols )
813+
ierr = copy_data( infile, in_julian_vid, tape%Files(1), out_julian_vid, in_start_col, nfils, ncols )
814814
endif
815815
if (in_occ_type_vid>0) then
816-
ierr = copy_data( infile, in_occ_type_vid, tape%File, out_occ_type_vid, in_start_col, nfils, ncols )
816+
ierr = copy_data( infile, in_occ_type_vid, tape%Files(1), out_occ_type_vid, in_start_col, nfils, ncols )
817817
endif
818818
if (in_localtime_vid>0) then
819-
ierr = copy_data( infile, in_localtime_vid, tape%File, out_localtime_vid, in_start_col, nfils, ncols )
819+
ierr = copy_data( infile, in_localtime_vid, tape%Files(1), out_localtime_vid, in_start_col, nfils, ncols )
820820
endif
821821
if (in_doy_vid>0) then
822-
ierr = copy_data( infile, in_doy_vid, tape%File, out_doy_vid, in_start_col, nfils, ncols )
822+
ierr = copy_data( infile, in_doy_vid, tape%Files(1), out_doy_vid, in_start_col, nfils, ncols )
823823
endif
824824

825825
call t_stopf ('sat_hist::write_record_coord')

0 commit comments

Comments
 (0)