Skip to content

Commit

Permalink
Formatting and TODOs
Browse files Browse the repository at this point in the history
  • Loading branch information
jwallwork23 committed Oct 22, 2024
1 parent e8a5db9 commit e119908
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 18 deletions.
15 changes: 4 additions & 11 deletions model/ATM_DRV.f
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ subroutine atm_phase1
#endif

call atm_phase1_exports

return
end subroutine atm_phase1

Expand Down Expand Up @@ -820,7 +820,7 @@ subroutine alloc_drv_atm()
#endif
#if defined( TRACERS_GC )
use CHEM_DRV, only : init_chem
!use CHEM_COM, only : alloc_chem_com
use CHEM_COM, only : alloc_chem_com
#endif
#if (defined TRACERS_ON) || (defined TRACERS_OCEAN)
use TRACER_COM, only: initTracerCom, alloc_tracer_com
Expand Down Expand Up @@ -1032,6 +1032,7 @@ subroutine new_io_atmvars(fid,iorw)
call tracerIO(fid, 'write_dist')
end select
#endif

#if defined( TRACERS_GC ) && ! defined( NEW_IO )
select case (iorw)
case (ioread)
Expand All @@ -1040,15 +1041,7 @@ subroutine new_io_atmvars(fid,iorw)
call IO_CHEM(fid, 'write_dist')
end select
#endif
#ifdef TRACERS_GC
select case (iorw)
case (ioread)
call IO_CHEM(fid, 'read_dist')
case (iowrite)
call IO_CHEM(fid, 'write_dist')
end select
#endif


call new_io_subdd (fid,iorw)
call new_io_fluxes (fid,iorw)
return
Expand Down
23 changes: 22 additions & 1 deletion model/CHEM_COM.F90
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ module CHEM_COM

end module CHEM_COM

! TODO: Uncomment or drop
! subroutine write_src_dist_data(fid, def)
! use pario, only: defvar, write_dist_data, write_data
! use domain_decomp_atm, only : grid
Expand Down Expand Up @@ -141,6 +142,7 @@ subroutine def_rsf_gcdiag(fid,r4_on_disk)
use chem_com, only : GCIJLN=>GCIJLN_loc
use chem_com, only : GCIJLS=>GCIJLS_loc
use chem_com, only : GCIJL=>GCIJL_out
! TODO: Uncomment or drop
! & GCIJN=>GCIJN_loc,
! & GCIJS=>GCIJS_loc,
! & GCJLN,
Expand All @@ -154,6 +156,7 @@ subroutine def_rsf_gcdiag(fid,r4_on_disk)
logical :: r4_on_disk !@var r4_on_disk if true, real*8 stored as real*4
if(r4_on_disk) then ! acc file
call defvar(grid,fid,gcijl,'gcijl(dist_im,dist_jm,lm,kgcijl)',r4_on_disk=.true.)
! TODO: Uncomment or drop
! call defvar(grid,fid,gcij,
! & 'gcij(dist_im,dist_jm,kgcij)',r4_on_disk=.true.)
! call defvar(grid,fid,gcjl,
Expand All @@ -162,6 +165,7 @@ subroutine def_rsf_gcdiag(fid,r4_on_disk)
else
call defvar(grid,fid,gcijln,'gcijln(dist_im,dist_jm,lm,ntm)')
call defvar(grid,fid,gcijls,'gcijls(dist_im,dist_jm,lm,kgcijl)')
! TODO: Uncomment or drop
! call defvar(grid,fid,gcijs,'gcijs(dist_im,dist_jm,kgcijs)')
! call defvar(grid,fid,gcijn,'gcijn(dist_im,dist_jm,kgcij,ntm)')
! call defvar(grid,fid,gcjln,'gcjln(jm_budg,lm,ktajlx,ntm)')
Expand All @@ -181,6 +185,7 @@ subroutine new_io_gcdiag(fid,iaction)
use chem_com, only : GCIJLN=>GCIJLN_loc
use chem_com, only : GCIJLS=>GCIJLS_loc
use chem_com, only : GCIJL=>GCIJL_out
! TODO: Uncomment or drop
! & GCIJN=>GCIJN_loc,
! & GCIJS=>GCIJS_loc,
! & GCJLN,
Expand All @@ -195,27 +200,32 @@ subroutine new_io_gcdiag(fid,iaction)
select case (iaction)
case (iowrite_single) ! output to acc file
call write_dist_data(grid,fid,'gcijl',gcijl)
! TODO: Uncomment or drop
!call write_dist_data(grid,fid,'gcij',gcij)
!call write_data(grid,fid,'gcjl',gcjl)
!call write_src_dist_data(fid, .false.)
case (iowrite) ! output to restart file
! TODO: Uncomment or drop
!call gather_zonal_gcdiag
call write_dist_data(grid,fid,'gcijln',gcijln)
call write_dist_data(grid,fid,'gcijls',gcijls)
! TODO: Uncomment or drop
!call write_dist_data(grid,fid,'gcijs',gcijs)
!call write_dist_data(grid,fid,'gcijn',gcijn)
!call write_data(grid,fid,'gcjln',gcjln)
!call write_data(grid,fid,'gcjls',gcjls)
case (ioread) ! input from restart file
call read_dist_data(grid,fid,'gcijln',gcijln)
call read_dist_data(grid,fid,'gcijls',gcijls)
! TODO: Uncomment or drop
!call read_dist_data(grid,fid,'gcijs',gcijs)
!call read_dist_data(grid,fid,'gcijn',gcijn)
!call read_data(grid,fid,'gcjln',gcjln)
!call read_data(grid,fid,'gcjls',gcjls)
!call scatter_zonal_gcdiag
end select

! TODO: Uncomment or drop
!call new_io_tcons(fid,iaction)

return
Expand All @@ -232,6 +242,7 @@ subroutine def_meta_gcdiag(fid)
implicit none
integer :: fid !@var fid file id

! TODO: Uncomment or drop
! call write_attr(grid,fid,'gcij','reduction','sum')
! call write_attr(grid,fid,'gcij','split_dim',3)
! call defvar(grid,fid,ia_gcij(1:kgcij_out),
Expand Down Expand Up @@ -263,6 +274,7 @@ subroutine def_meta_gcdiag(fid)
call defvar_cdl(grid,fid,cdl_gcijl_latlon,'cdl_gcijl_latlon(cdl_strlen,kcdl_gcijl_latlon)')
#endif

! TODO: Uncomment or drop
! call write_attr(grid,fid,'gcjl','reduction','sum')
! call write_attr(grid,fid,'gcjl','split_dim',3)
! call defvar(grid,fid,ia_gcjl(1:ktajl_out),
Expand Down Expand Up @@ -297,6 +309,7 @@ subroutine write_meta_gcdiag(fid)
implicit none
integer :: fid !@var fid file id

! TODO: Uncomment or drop
! call write_data(grid,fid,'hemis_gcij',hemis_gcij)
! call write_data(grid,fid,'ia_gcij',ia_gcij(1:kgcij_out))
! call write_data(grid,fid,'denom_gcij',denom_gcij(1:kgcij_out))
Expand All @@ -316,19 +329,20 @@ subroutine write_meta_gcdiag(fid)
call write_cdl(grid,fid,'cdl_gcijl_latlon',cdl_gcijl_latlon)
#endif

! TODO: Uncomment or drop
! call write_data(grid,fid,'hemis_gcjl',hemis_gcjl)
! call write_data(grid,fid,'vmean_gcjl',vmean_gcjl)
! call write_data(grid,fid,'ia_gcjl',ia_gcjl(1:ktajl_out))
! call write_data(grid,fid,'denom_gcjl',denom_gcjl(1:ktajl_out))
! call write_data(grid,fid,'scale_gcjl',scale_gcjl(1:ktajl_out))
! call write_data(grid,fid,'sname_gcjl',sname_gcjl(1:ktajl_out))
! call write_cdl(grid,fid,'cdl_gcjl',cdl_gcjl)

! call write_meta_tcons(fid)

return
end subroutine write_meta_gcdiag

! TODO: Uncomment or drop
! subroutine def_rsf_tcons(fid,r4_on_disk)
!!@sum def_rsf_tcons defines tracer diag array structure in restart+acc files
!!@auth M. Kelley
Expand Down Expand Up @@ -472,6 +486,7 @@ SUBROUTINE ALLOC_CHEM_COM
RETURN
END SUBROUTINE ALLOC_CHEM_COM

! TODO: Uncomment or drop
! subroutine reset_tcons
! USE CHEM_COM, only: TCONSRV_loc, TCONSRV
! USE DOMAIN_DECOMP_ATM, only : am_i_root
Expand Down Expand Up @@ -537,10 +552,12 @@ subroutine reset_gcdiag
USE DOMAIN_DECOMP_ATM, only : am_i_root
implicit none

! TODO: Uncomment or drop
!TAJLN_loc=0.
!TAJLS_loc=0.
GCIJLN_loc=0.
GCIJLS_loc=0.
! TODO: Uncomment or drop
!TAIJN_loc=0.
!TAIJS_loc=0.
!if(am_i_root()) then
Expand All @@ -559,6 +576,7 @@ subroutine gather_gcdiag

CALL PACK_DATA (GRID, GCIJLN_loc, GCIJLN)
CALL PACK_DATA (GRID, GCIJLS_loc, GCIJLS)
! TODO: Uncomment or drop
!CALL PACK_DATA (GRID, GCIJN_loc , GCIJN)
!CALL PACK_DATA (GRID, GCIJS_loc , GCIJS)
!call gather_zonal_gcdiag
Expand All @@ -567,6 +585,7 @@ subroutine gather_gcdiag
return
end subroutine gather_gcdiag

! TODO: Uncomment or drop
!subroutine gather_zonal_gcdiag
! USE CHEM_COM, only : GCJLN , GCJLN_loc, GCJLS, GCJLS_loc
! USE DOMAIN_DECOMP_ATM, ONLY : GRID
Expand All @@ -584,13 +603,15 @@ subroutine scatter_gcdiag
implicit none
CALL UNPACK_DATA (GRID, GCIJLN, GCIJLN_loc)
CALL UNPACK_DATA (GRID, GCIJLS, GCIJLS_loc)
! TODO: Uncomment or drop
!CALL UNPACK_DATA (GRID, GCIJN , GCIJN_loc)
!CALL UNPACK_DATA (GRID, GCIJS , GCIJS_loc)
!call scatter_zonal_gcdiag
!call scatter_zonal_tcons
return
end subroutine scatter_gcdiag

! TODO: Uncomment or drop
!subroutine scatter_zonal_gcdiag
! USE CHEM_COM, only : GCJLN , GCJLN_loc, GCJLS, GCJLS_loc
! USE DOMAIN_DECOMP_ATM, ONLY : GRID
Expand Down
12 changes: 6 additions & 6 deletions model/CHEM_DRV.F90
Original file line number Diff line number Diff line change
Expand Up @@ -78,17 +78,17 @@ module CHEM_DRV

! Ap [hPa] for 40 levels (41 edges)
REAL(fp), PARAMETER :: AP(41) = (/ &
0.000000, 3.597122, 7.553957, 12.050360, &
0.000000, 3.597122, 7.553957, 12.050360, &
16.906475, 22.302158, 28.597122, 35.791367, &
43.884892, 52.517986, 61.510791, 70.683453, &
80.035971, 89.028777, 97.661871, 105.755396, &
113.309353, 120.143885, 126.258993, 131.834532, &
136.870504, 141.546763, 145.863309, 150.000000, &
128.000000, 108.000000, 90.000000, 73.000000, &
113.309353, 120.143885, 126.258993, 131.834532, &
136.870504, 141.546763, 145.863309, 150.000000, &
128.000000, 108.000000, 90.000000, 73.000000, &
57.000000, 43.000000, 31.000000, 20.000000, &
10.000000, 5.620000, 3.160000, 1.780000, &
1.000000, 0.562000, 0.316000, 0.178000, &
0.100000 /)
1.000000, 0.562000, 0.316000, 0.178000, &
0.100000 /)

! Bp [unitless] for 40 levels (41 edges)
REAL(fp), PARAMETER :: BP(41) = (/ &
Expand Down
1 change: 1 addition & 0 deletions model/shared/AbstractCalendar.F90
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,7 @@ subroutine printTransitionDates(this, unit)
class (AbstractTimeStamp), pointer :: p
character(len=24) :: fmt

! FIXME: This code causes a segfault with recent gfortran
! iter = this%transitionDates%begin()
! do while(iter /= this%transitionDates%last())
! p => iter%value()
Expand Down

0 comments on commit e119908

Please sign in to comment.