New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
Changeset 575 for trunk/NEMO/OPA_SRC/DYN/dynspg_exp.F90 – NEMO

Ignore:
Timestamp:
2006-11-14T09:04:20+01:00 (17 years ago)
Author:
opalod
Message:

nemo_v1_bugfix_079: CT : - add the creation of restart file (saving sshn & sshb) when using the explicit surface pressure option

  • light modifications in the way to read/write restart files in dynspg_* and associated _jki_ modules (key_mpp_omp removed)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/NEMO/OPA_SRC/DYN/dynspg_exp.F90

    r455 r575  
    44   !! Ocean dynamics:  surface pressure gradient trend 
    55   !!====================================================================== 
    6 #if ( defined key_dynspg_exp && ! defined key_mpp_omp ) ||   defined key_esopa 
     6#if defined key_dynspg_exp  ||   defined key_esopa 
    77   !!---------------------------------------------------------------------- 
    88   !!   'key_dynspg_exp'           free sfce cst vol. without filter nor ts 
    9    !!   NOT 'key_mpp_omp'                          k-j-i loop (vector opt.) 
    109   !!---------------------------------------------------------------------- 
    1110   !!   dyn_spg_exp  : update the momentum trend with the surface  
    1211   !!                      pressure gradient in the free surface constant   
    1312   !!                      volume case with vector optimization 
     13   !!   exp_rst      : read/write the explicit restart fields in the ocean restart file 
    1414   !!---------------------------------------------------------------------- 
    1515   !! * Modules used 
     
    2525   USE lbclnk          ! ocean lateral boundary conditions (or mpp link) 
    2626   USE prtctl          ! Print control 
     27   USE iom             ! I/O library 
     28   USE restart         ! only for lrst_oce 
    2729 
    2830   IMPLICIT NONE 
     
    3133   !! * Accessibility 
    3234   PUBLIC dyn_spg_exp  ! routine called by step.F90 
     35   PUBLIC exp_rst      ! routine called j-k-i subroutine 
    3336 
    3437   !! * Substitutions 
     
    101104         spgu(:,:) = 0.e0                     ! surface pressure gradient (i-direction) 
    102105         spgv(:,:) = 0.e0                     ! surface pressure gradient (j-direction) 
     106 
     107         CALL exp_rst( nit000, 'READ' )       ! read or initialize the following fields: 
     108         !                                    ! sshb, sshn 
     109 
    103110      ENDIF 
    104111 
     
    185192      ! Boundary conditions on sshn 
    186193      IF( .NOT. lk_obc ) CALL lbc_lnk( sshn, 'T', 1. ) 
     194 
     195      ! write filtered free surface arrays in restart file 
     196      ! -------------------------------------------------- 
     197      IF( lrst_oce )   CALL exp_rst( kt, 'WRITE' ) 
    187198  
    188199      IF(ln_ctl) THEN         ! print sum trends (used for debugging) 
     
    192203   END SUBROUTINE dyn_spg_exp 
    193204 
     205   SUBROUTINE exp_rst( kt, cdrw ) 
     206      !!--------------------------------------------------------------------- 
     207      !!                   ***  ROUTINE exp_rst  *** 
     208      !! 
     209      !! ** Purpose : Read or write explicit arrays in restart file 
     210      !!---------------------------------------------------------------------- 
     211      INTEGER         , INTENT(in) ::   kt         ! ocean time-step 
     212      CHARACTER(len=*), INTENT(in) ::   cdrw       ! "READ"/"WRITE" flag 
     213      ! 
     214      !!---------------------------------------------------------------------- 
     215      ! 
     216      IF( TRIM(cdrw) == 'READ' ) THEN 
     217         IF( iom_varid( numror, 'sshn' ) > 0 ) THEN 
     218            CALL iom_get( numror, jpdom_local, 'sshb'  , sshb(:,:)   ) 
     219            CALL iom_get( numror, jpdom_local, 'sshn'  , sshn(:,:)   ) 
     220            IF( neuler == 0 ) sshb(:,:) = sshn(:,:) 
     221         ELSE 
     222            IF( nn_rstssh == 1 ) THEN   
     223               sshb(:,:) = 0.e0 
     224               sshn(:,:) = 0.e0 
     225            ENDIF 
     226         ENDIF 
     227      ELSEIF( TRIM(cdrw) == 'WRITE' ) THEN 
     228         CALL iom_rstput( kt, nitrst, numrow, 'sshb'  , sshb  (:,:) ) 
     229         CALL iom_rstput( kt, nitrst, numrow, 'sshn'  , sshn  (:,:) ) 
     230      ENDIF 
     231      ! 
     232   END SUBROUTINE exp_rst 
    194233#else 
    195234   !!---------------------------------------------------------------------- 
Note: See TracChangeset for help on using the changeset viewer.