Skip to content

Commit

Permalink
minor changes in response to review
Browse files Browse the repository at this point in the history
  • Loading branch information
jmaerz committed Nov 6, 2024
1 parent f25b1a8 commit e242ce9
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 12 deletions.
4 changes: 2 additions & 2 deletions hamocc/mo_hamocc_init.F90
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ subroutine hamocc_init(read_rest,rstfnm_hamocc)
use mo_aufr_bgc, only: aufr_bgc
use mo_extNsediment,only: alloc_mem_extNsediment_diag
use mo_ihamocc4m4ago, only: alloc_mem_m4ago,init_m4ago_nml_params, init_m4ago_params
use mo_read_shelfmask,only: read_shelfmask,shelfsea_maskfile
use mo_read_shelfmask,only: ini_read_shelfmask,shelfsea_maskfile


! Arguments
Expand Down Expand Up @@ -204,7 +204,7 @@ subroutine hamocc_init(read_rest,rstfnm_hamocc)
call ini_read_ndep(idm,jdm)
end if
call ini_read_rivin(idm,jdm,omask)
call read_shelfmask(idm,jdm,nbdy,depths,omask)
call ini_read_shelfmask(idm,jdm,nbdy,depths,omask)
call ini_read_oafx(idm,jdm,bgc_dx,bgc_dy,plat,omask)
if (use_BROMO) then
call ini_swa_clim(idm,jdm,omask)
Expand Down
4 changes: 2 additions & 2 deletions hamocc/mo_ncout_hamocc.F90
Original file line number Diff line number Diff line change
Expand Up @@ -804,7 +804,7 @@ subroutine ncwrt_bgc(iogrp)
call wrtlvl(jlvlprefdic(iogrp), LVL_PREFDIC(iogrp), rnacc*1e3, 0.,cmpflg,'p_diclvl')
endif
if (use_shelfsea_res_time) then
call wrtlvl(jlvlshelfage(iogrp), LVL_SHELFAGE(iogrp), rnacc, 0.,cmpflg,'shelfage_lvl')
call wrtlvl(jlvlshelfage(iogrp), LVL_SHELFAGE(iogrp), rnacc, 0.,cmpflg,'shelfagelvl')
endif
if (use_cisonew) then
call wrtlvl(jlvldic13(iogrp), LVL_DIC13(iogrp), rnacc*1.e3, 0.,cmpflg,'dissic13lvl')
Expand Down Expand Up @@ -1918,7 +1918,7 @@ subroutine hamoccvardef(iogrp,timeunits,calendar,cmpflg)
endif
if (use_shelfsea_res_time) then
call ncdefvar3d(LVL_SHELFAGE(iogrp),cmpflg,'p', &
& 'shelfage_lvl','Residence time of shelf water',' ','d',2)
& 'shelfagelvl','Residence time of shelf water',' ','d',2)
endif
if (use_cisonew) then
call ncdefvar3d(LVL_DIC13(iogrp),cmpflg,'p', &
Expand Down
17 changes: 9 additions & 8 deletions hamocc/mo_read_shelfmask.F90
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
! Copyright (C) 2021-2022 J. Schwinger
! Copyright (C) 2021-2024 J. Schwinger
!
! This file is part of BLOM/iHAMOCC.
!
Expand Down Expand Up @@ -34,14 +34,14 @@ module mo_read_shelfmask
implicit none
private

public :: read_shelfmask
public :: ini_read_shelfmask

character(len=512), public :: shelfsea_maskfile =''
logical, allocatable, protected, public :: shelfmask(:,:)

contains

subroutine read_shelfmask(kpie,kpje,kbnd,pbath,omask)
subroutine ini_read_shelfmask(kpie,kpje,kbnd,pbath,omask)

use mod_xc, only: mnproc,xchalt
use mod_dia, only: iotype
Expand Down Expand Up @@ -72,13 +72,14 @@ subroutine read_shelfmask(kpie,kpje,kbnd,pbath,omask)
return
endif

! Check if shelfsea mask file exists. If not, abort.
! Check if shelfsea mask file exists. If not, run in default mode.
inquire(file=shelfsea_maskfile,exist=file_exists)
if (.not. file_exists .and. mnproc.eq.1) then
write(io_stdo_bgc,*) ''
write(io_stdo_bgc,*) '**********************************************************'
write(io_stdo_bgc,*) 'read_shelfmask: Cannot find shelf sea region mask file... '
write(io_stdo_bgc,*) '... using internal bathymetry data to reconstruct the mask'
write(io_stdo_bgc,*) '************************************************************'
write(io_stdo_bgc,*) 'read_shelfmask: Cannot find (shelf sea) region mask file. '
write(io_stdo_bgc,*) 'Fallback to default ... '
write(io_stdo_bgc,*) '... using internal bathymetry data to reconstruct the mask '
endif

! Allocate field to hold shelfsea mask
Expand Down Expand Up @@ -128,6 +129,6 @@ subroutine read_shelfmask(kpie,kpje,kbnd,pbath,omask)
enddo
!$OMP END PARALLEL DO

end subroutine read_shelfmask
end subroutine ini_read_shelfmask

end module mo_read_shelfmask

0 comments on commit e242ce9

Please sign in to comment.