@@ -265,7 +265,6 @@ end subroutine copy_entry_interface
265265 ! practice are all disabled. Fields for those tapes have to be specified
266266 ! explicitly and manually via hist_fincl2 et al.
267267 type, extends(entry_base) :: allhistfldlist_entry
268- ! 10) TODO DONE Add 2nd dim to actflag, which should make fld unique by file
269268 logical :: actflag(max_tapes,maxsplitfiles) ! which history tapes to write to
270269 character (len= avgflag_strlen) :: avgflag(max_tapes) ! type of time averaging
271270 contains
@@ -340,14 +339,12 @@ end subroutine copy_entry_interface
340339 ! Other variables
341340 !
342341 character (len= max_length_filename) :: locfnh(max_tapes, maxsplitfiles) ! local history file names
343- ! 11a) TODO DONE History restart files seem to mirror history files => need the second dimension I think
344342 character (len= max_length_filename) :: locfnhr(max_tapes, maxsplitfiles) ! local history restart file names
345343 logical :: htapes_defined = .false. ! flag indicates history output fields have been defined
346344 !
347345 ! NetCDF Id's
348346 !
349347 type (file_desc_t), target :: nfid(max_tapes, maxsplitfiles) ! file ids
350- ! 11b) TODO DONE History restart files seem to mirror history files => need the second dimension I think
351348 type (file_desc_t), target :: ncid_hist(max_tapes, maxsplitfiles) ! file ids for history restart files
352349 integer :: time_dimid ! time dimension id
353350 integer :: nbnd_dimid ! time bounds dimension id
@@ -755,7 +752,6 @@ subroutine allhistfldlist_make_active (name, tape_index, avgflag)
755752 character (len=* ), intent (in ), optional :: avgflag ! time averaging flag
756753 !
757754 ! !LOCAL VARIABLES:
758- ! 7a) TODO DONE Replace old f with fld; search "do f" "(f" 'f)" ...
759755 integer :: fld ! field index
760756 logical :: found ! flag indicates field found in allhistfldlist
761757 character (len=* ),parameter :: subname = ' allhistfldlist_make_active'
@@ -931,7 +927,6 @@ subroutine htapes_fieldlist()
931927 ! Add the field to the tape if specified via namelist (FINCL[1-max_tapes]),
932928 ! or if it is on by default and was not excluded via namelist (FEXCL[1-max_tapes]).
933929
934- ! 8) TODO DONE do f = 1, maxsplitfiles where needed; search "do t"
935930 file_loop1: do f = 1 , maxsplitfiles
936931 fld_loop: do fld = 1 , nallhistflds
937932 allhistfldname = allhistfldlist(fld)% field% name
@@ -1001,7 +996,6 @@ subroutine htapes_fieldlist()
1001996 if (ntapes > 0 ) exit
1002997 end do
1003998
1004- ! 9) TODO DONE Change nflds to nflds(f) throughout
1005999 do t = 1 , ntapes
10061000 do f = 1 , maxsplitfiles
10071001 if (tape(t)% nflds(f) > 0 ) then
@@ -2396,7 +2390,6 @@ subroutine htape_create (t, f, histrest)
23962390 logical , intent (in ), optional :: histrest ! if creating the history restart file
23972391 !
23982392 ! !LOCAL VARIABLES:
2399- ! 5) TODO DONE Rm old f in this subr. as unused and introduce f as file index
24002393 integer :: p,c,l,n ! indices
24012394 integer :: ier ! error code
24022395 integer :: num2d ! size of second dimension (e.g. number of vertical levels)
@@ -2707,7 +2700,6 @@ subroutine htape_add_cft_metadata(lnfid)
27072700 end subroutine htape_add_cft_metadata
27082701
27092702 !- ----------------------------------------------------------------------
2710- ! 7b) TODO DONE Add argument f in the call
27112703 subroutine htape_timeconst3D (t , f , &
27122704 bounds , watsat_col , sucsat_col , bsw_col , hksat_col , &
27132705 cellsand_col , cellclay_col , mode )
@@ -2830,9 +2822,8 @@ subroutine htape_timeconst3D(t, f, &
28302822 end if
28312823 if (tape(t)% dov2xy) then
28322824 if (ldomain% isgrid2d) then
2833- ! 6) TODO DONE Changed nfid(t) to (t,f) throughout
28342825 ! TODO LATER Use ncid => nfid(t,f) here and elsewhere if possible, as done in
2835- ! subroutine hfields_1dinfo
2826+ ! subroutine hfields_1dinfo; repeat in mosart
28362827 call ncd_defvar(ncid= nfid(t,f), varname= trim (varnames(ifld)), xtype= tape(t)% ncprec,&
28372828 dim1name= ' lon' , dim2name= ' lat' , dim3name= ' levgrnd' , &
28382829 long_name= long_name, units= units, missing_value= spval, fill_value= spval, &
@@ -3080,7 +3071,6 @@ subroutine htape_timeconst3D(t, f, &
30803071 end subroutine htape_timeconst3D
30813072
30823073 !- ----------------------------------------------------------------------
3083- ! 7c) TODO DONE Add argument f in the call
30843074 subroutine htape_timeconst (t , f , mode )
30853075 !
30863076 ! !DESCRIPTION:
@@ -3627,7 +3617,6 @@ subroutine htape_timeconst(t, f, mode)
36273617 end subroutine htape_timeconst
36283618
36293619 !- ----------------------------------------------------------------------
3630- ! 7d) TODO DONE Add argument f in the call
36313620 subroutine hfields_write (t , f , mode )
36323621 !
36333622 ! !DESCRIPTION:
@@ -3824,7 +3813,6 @@ subroutine hfields_1dinfo(t, f, mode)
38243813 character (len=* ), intent (in ) :: mode ! 'define' or 'write'
38253814 !
38263815 ! !LOCAL VARIABLES:
3827- ! 7e) TODO DONE Rm old f in this subr. as unused and introduce f as file index
38283816 integer :: k ! 1d index
38293817 integer :: g,c,l,p ! indices
38303818 integer :: ier ! errir status
@@ -4226,7 +4214,6 @@ subroutine hist_htapes_wrapup( rstwr, nlend, bounds, &
42264214 cycle
42274215 end if
42284216
4229- ! 14) TODO NEXT is_endhist may need file dimension
42304217 ! Determine if end of history interval
42314218 tape(t)% is_endhist = .false.
42324219 if (tape(t)% nhtfrq== 0 ) then ! monthly average
@@ -4254,7 +4241,6 @@ subroutine hist_htapes_wrapup( rstwr, nlend, bounds, &
42544241
42554242 if (tape(t)% ntimes(f) == 1 ) then
42564243 call t_startf(' hist_htapes_wrapup_define' )
4257- ! 2) TODO DONE Changed locfnh(t) to locfnh(t,f) throughout
42584244 locfnh(t,f) = set_hist_filename (hist_freq= tape(t)% nhtfrq, &
42594245 hist_mfilt= tape(t)% mfilt, hist_file= t, f_index= f)
42604246 if (masterproc) then
@@ -4418,7 +4404,6 @@ subroutine hist_restart_ncd (bounds, ncid, flag, rdate)
44184404 character (len= max_chars) :: units ! units of variable
44194405 character (len= max_chars) :: units_acc ! accumulator units
44204406 character (len= max_chars) :: fname ! full name of history file
4421- ! 11c) TODO DONE History restart files seem to mirror history files => need the second dimension I think
44224407 character (len= max_chars) :: locrest(max_tapes, maxsplitfiles) ! local history restart file names
44234408 character (len= max_chars) :: locrest_onfile(maxsplitfiles, max_tapes) ! local history restart file names, dims flipped
44244409 character (len= max_chars) :: locfnh_onfile(maxsplitfiles, max_tapes) ! local history file names, dims flipped
@@ -4726,7 +4711,6 @@ subroutine hist_restart_ncd (bounds, ncid, flag, rdate)
47264711 ! Add history filenames to master restart file
47274712 counter = 0
47284713 tape_loop2: do t = 1 , ntapes
4729- ! 3) TODO DONE Changed history_tape_in_use(t) to (t,f) throughout
47304714 file_loop2: do f = 1 , maxsplitfiles
47314715 counter = counter + 1
47324716 if (history_tape_in_use(t,f) == 0 ) then
@@ -4741,7 +4725,6 @@ subroutine hist_restart_ncd (bounds, ncid, flag, rdate)
47414725 end do file_loop2
47424726 end do tape_loop2
47434727
4744- ! 12a) TODO DONE (NOT DONE) LHS fincl & fexcl may need the file dimension
47454728 fincl(:,1 ) = hist_fincl1(:)
47464729 fincl(:,2 ) = hist_fincl2(:)
47474730 fincl(:,3 ) = hist_fincl3(:)
@@ -4779,7 +4762,6 @@ subroutine hist_restart_ncd (bounds, ncid, flag, rdate)
47794762 cycle
47804763 end if
47814764
4782- ! 12c) TODO DONE (NOT DONE) fincl & fexcl may need the file dimension
47834765 call ncd_io(varname= ' fincl' , data = fincl(:,t), ncid= ncid_hist(t,f), flag= ' write' )
47844766
47854767 call ncd_io(varname= ' fexcl' , data = fexcl(:,t), ncid= ncid_hist(t,f), flag= ' write' )
@@ -4855,7 +4837,6 @@ subroutine hist_restart_ncd (bounds, ncid, flag, rdate)
48554837 end if
48564838
48574839 ntapes_gt_0: if (ntapes > 0 ) then
4858- ! 4) TODO DONE Changed history_tape_in_use_onfile(t) to (t,f) throughout
48594840 allocate (history_tape_in_use_onfile(maxsplitfiles, ntapes))
48604841 call ncd_io(' history_tape_in_use' , history_tape_in_use_onfile, ' read' , ncid, &
48614842 readvar= readvar)
@@ -4928,7 +4909,6 @@ subroutine hist_restart_ncd (bounds, ncid, flag, rdate)
49284909 call ncd_inqvid(ncid_hist(t,f), ' c2l_scale_type' , varid, c2l_scale_type_desc)
49294910 call ncd_inqvid(ncid_hist(t,f), ' l2g_scale_type' , varid, l2g_scale_type_desc)
49304911
4931- ! 12d) TODO DONE (NOT DONE) fincl & fexcl may need the file dimension
49324912 call ncd_io(varname= ' fincl' , data = fincl(:,t), ncid= ncid_hist(t,f), flag= ' read' )
49334913
49344914 call ncd_io(varname= ' fexcl' , data = fexcl(:,t), ncid= ncid_hist(t,f), flag= ' read' )
@@ -5075,7 +5055,6 @@ subroutine hist_restart_ncd (bounds, ncid, flag, rdate)
50755055 end do file_loop6
50765056 end do tape_loop6
50775057
5078- ! 12b) TODO DONE (NOT DONE) LHS fincl & fexcl may need the file dimension
50795058 hist_fincl1(:) = fincl(:,1 )
50805059 hist_fincl2(:) = fincl(:,2 )
50815060 hist_fincl3(:) = fincl(:,3 )
@@ -5385,10 +5364,6 @@ character(len=max_length_filename) function set_hist_filename (hist_freq, hist_m
53855364 else if (f_index == accumulated_file_index) then
53865365 file_index = ' a' ! accumulated file_index
53875366 end if
5388- ! 1) TODO DONE After hist_index added file_index = "i" or "a"
5389- ! See maxsplitfiles in https://github.com/ESCOMP/CAM/pull/903/files
5390- ! See CAM#1003 for a bug-fix in monthly avged output
5391- ! TODO FINAL search all the vars that I modified to make sure I did not miss any of them
53925367 set_hist_filename = " ./" // trim (caseid)// " ." // trim (compname)// trim (inst_suffix)// &
53935368 " .h" // hist_index// file_index// " ." // trim (cdate)// " .nc"
53945369
0 commit comments