Skip to content

Commit

Permalink
change netcdf read for shelf sea mask
Browse files Browse the repository at this point in the history
  • Loading branch information
jmaerz committed Oct 31, 2024
1 parent e950b24 commit 46e706c
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions hamocc/mo_read_shelfmask.F90
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ subroutine read_shelfmask(kpie,kpje,kbnd,pbath,omask)
use mod_nctools, only: ncfopn,ncread,ncfcls
use mo_control_bgc, only: use_shelfsea_res_time,io_stdo_bgc
use mo_param_bgc, only: shelfbreak_depth
use netcdf, only: nf90_open,nf90_close,nf90_nowrite
use mo_netcdf_bgcrw,only: read_netcdf_var

!Arguments
integer, intent(in) :: kpie ! 1st dimension of model grid
Expand All @@ -58,7 +60,7 @@ subroutine read_shelfmask(kpie,kpje,kbnd,pbath,omask)

! Local variables
logical :: file_exists=.false.
integer :: i,j,errstat,dummymask(2)
integer :: i,j,errstat,dummymask(2),ncid,ncstat
real,allocatable :: mask(:,:)


Expand Down Expand Up @@ -98,9 +100,14 @@ subroutine read_shelfmask(kpie,kpje,kbnd,pbath,omask)
write(io_stdo_bgc,*) ''
write(io_stdo_bgc,'(a)') 'read_shelfmask: read mask from ',trim(shelfsea_maskfile)
endif
call ncfopn(trim(shelfsea_maskfile),'r',' ',1,iotype)
call ncread('shelfmask',mask,dummymask,0,0.)
call ncfcls

ncstat=nf90_open(trim(shelfsea_maskfile),nf90_nowrite,ncid)
call read_netcdf_var(ncid,'shelfmask',mask,1,1,0)
ncstat=nf90_close(ncid)

!call ncfopn(trim(shelfsea_maskfile),'r',' ',1,iotype)
!call ncread('shelfmask',mask,dummymask,0,0.)
!call ncfcls
else
! reconstruct shelf sea mask from internal bathymetry
!$OMP DO PARALLEL PRIVATE (i,j)
Expand Down

0 comments on commit 46e706c

Please sign in to comment.