Opened 3 years ago

Closed 17 months ago

#1871 closed Bug (fixed)

NESTING TOOLS AGRIF read mbathy and NOT bathy_level for agrif_create_restart

Reported by: jharlass Owned by: sciliberti
Priority: normal Milestone:
Component: AGRIF Version: release-3.6
Severity: minor Keywords: AGRIF bathymetry nesting
Cc: sciliberti

Description

Context

  1. agrif_create_restart reads bathymetry on levels from mesh_mash.nc to create all masks. In the old code it is looking for Bathy_Level, which no longer exists. Use mbathy instead.
  2. add support for partial step (exisiting routines)

Fix

  • (a) Revision vs. (b) Working

    a b  
    555556  SUBROUTINE Init_mask(name,Grid,jpiglo,jpjglo) 
    556557    ! 
    557558    USE io_netcdf 
    558559    ! 
    559560    CHARACTER(*) name 
    560561    INTEGER :: nx,ny,k,i,j,jpiglo,jpjglo 
    561562    TYPE(Coordinates) :: Grid 
    562563    REAL*8, POINTER, DIMENSION(:,:) ::zwf => NULL() 
    563564    ! 
     565    ! cjh, no Bathy_level -> mbathy from (1_)mesh_mask.nc 
    564566    IF(jpiglo == 1 .AND. jpjglo == 1) THEN 
    565        CALL Read_Ncdf_var('Bathy_level',name,Grid%Bathy_level) 
     567      CALL Read_Ncdf_var('mbathy'  ,name ,Grid%Bathy_level) 
    566568    ELSE 
    567        CALL Read_Ncdf_var('Bathy_level',name,Grid%Bathy_level,(/jpizoom,jpjzoom/),(/jpiglo,jpjglo/) ) 
     569      CALL Read_Ncdf_var('mbathy',name,Grid%Bathy_level,(/jpizoom,jpjzoom/),(/jpiglo,jpjglo/) ) 
    568570    ENDIF 
    569571    ! 
    570572    WRITE(*,*) 'Init masks in T,U,V,F points'     
    571573    ! 
    572574    nx = SIZE(Grid%Bathy_level,1) 
    573575    ny = SIZE(Grid%Bathy_level,2) 
    574576    !       
    575577    ALLOCATE(Grid%tmask(nx,ny,N), & 
    576578         Grid%umask(nx,ny,N), & 
    577579         Grid%vmask(nx,ny,N), & 
    578580         Grid%fmask(nx,ny,N)) 
     581 
     582    ! cjh, important for correct mbathy and masks calculation 
     583    IF(partial_steps) THEN 
     584      CALL get_partial_steps(Grid) 
     585    END IF 
     586 
     587    ! checks for all levels for landpoints 
    579588    DO k = 1,N 
    580        !       
    581        WHERE(Grid%Bathy_level(:,:) <= k-1 )     
     589    ! nemo syntax 
     590       WHERE( Grid%Bathy_level(:,:) - k + 0.1 >= 0 ) 
     591          Grid%tmask(:,:,k) = 1 
     592       ELSEWHERE 
    582593          Grid%tmask(:,:,k) = 0 
    583        ELSEWHERE 
    584           Grid%tmask(:,:,k) = 1 
    585594       END WHERE 
    586        ! 
    587595    END DO 
    588596    ! 
    589597    Grid%umask(1:nx-1,:,:) = Grid%tmask(1:nx-1,:,:)*Grid%tmask(2:nx,:,:) 

Commit History (0)

(No commits)

Change History (7)

comment:1 Changed 3 years ago by jharlass

Addendum:
Subroutine Init_mask in file: agrif_readwrite.f90
Called from agrif_create_restart.f90

comment:2 Changed 3 years ago by nemo

  • Keywords nesting added; NESTING removed

comment:3 Changed 3 years ago by jchanut

  • Component changed from OPA to AGRIF

comment:4 Changed 3 years ago by clevy

  • Owner changed from nemo to sciliberti

comment:5 Changed 3 years ago by clevy

  • Cc sciliberti added
  • Status changed from new to assigned

comment:6 Changed 3 years ago by clevy

  • Priority changed from critical to major

comment:7 Changed 17 months ago by jchanut

  • Resolution set to fixed
  • Severity set to minor
  • Status changed from assigned to closed

Use the very last NESTING tool version (no correction made to the one provided with NEMO 3.6_STABLE)

Note: See TracTickets for help on using tickets.