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 15455 for NEMO/branches/UKMO/r14075_ukmo_shelf/src/OCE/SBC/sbccpl.F90 – NEMO

Ignore:
Timestamp:
2021-10-28T11:23:37+02:00 (3 years ago)
Author:
jcastill
Message:

Code for uncoupled configurations, some changes for coupling may be needed yet - merged branch branches/UKMO/r14075_cpl-pressure@15423

File:
1 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/UKMO/r14075_ukmo_shelf/src/OCE/SBC/sbccpl.F90

    r14075 r15455  
    209209#endif 
    210210 
    211    REAL(wp) ::   rpref = 101000._wp   ! reference atmospheric pressure[N/m2]  
    212    REAL(wp) ::   r1_grau              ! = 1.e0 / (grav * rau0)  
    213  
    214211   INTEGER , ALLOCATABLE, SAVE, DIMENSION(:) ::   nrcvinfo           ! OASIS info argument 
    215212 
     
    573570      !                                                      ! Mean Sea Level Pressure   !  
    574571      !                                                      ! ------------------------- !  
    575       srcv(jpr_mslp)%clname = 'O_MSLP'     ;   IF( TRIM(sn_rcv_mslp%cldes  ) == 'coupled' )    srcv(jpr_mslp)%laction = .TRUE.  
     572      srcv(jpr_mslp)%clname = 'O_MSLP'    
     573      IF( TRIM(sn_rcv_mslp%cldes  ) == 'coupled' ) THEN    
     574         srcv(jpr_mslp)%laction = .TRUE.    
     575         cpl_mslp = .TRUE.    
     576      ENDIF 
    576577      ! 
    577578      !                                                      ! ------------------------- ! 
     
    11221123      !!---------------------------------------------------------------------- 
    11231124      USE zdf_oce,  ONLY :   ln_zdfswm 
     1125      USE sbcssm ,  ONLY :   sbc_ssm_cpl    
     1126      USE lib_fortran     ! distributed memory computing library 
    11241127      ! 
    11251128      INTEGER, INTENT(in) ::   kt          ! ocean model time step index 
     
    12941297      !                                                      ! ========================= !  
    12951298      IF( srcv(jpr_mslp)%laction ) THEN                    ! UKMO SHELF effect of atmospheric pressure on SSH  
    1296           IF( kt /= nit000 )   ssh_ibb(:,:) = ssh_ib(:,:)    !* Swap of ssh_ib fields  
    1297  
    1298           r1_grau = 1.e0 / (grav * rau0)               !* constant for optimization  
    1299           ssh_ib(:,:) = - ( frcv(jpr_mslp)%z3(:,:,1) - rpref ) * r1_grau    ! equivalent ssh (inverse barometer)  
    1300           apr   (:,:) =     frcv(jpr_mslp)%z3(:,:,1)                         !atmospheric pressure  
     1299          IF( ln_apr_dyn ) THEN   
     1300             IF( kt /= nit000 )   ssh_ibb(:,:) = ssh_ib(:,:)   !* Swap of ssh_ib fields 
    13011301     
    1302           IF( kt == nit000 ) ssh_ibb(:,:) = ssh_ib(:,:)  ! correct this later (read from restart if possible)  
     1302             !                                                  !* update the reference atmospheric pressure (if necessary)    
     1303             IF( ln_ref_apr )  rn_pref = glob_sum( 'sbccpl', frcv(jpr_mslp)%z3(:,:,1) * e1e2t(:,:) ) / tarea   
     1304 
     1305             ssh_ib(:,:) = - ( frcv(jpr_mslp)%z3(:,:,1) - rn_pref ) * r1_grau  ! equivalent ssh (inverse barometer)    
     1306             apr   (:,:) =     frcv(jpr_mslp)%z3(:,:,1)                        !atmospheric pressure    
     1307             !   
     1308             CALL iom_put( "ssh_ib", ssh_ib )                                  !* output the inverse barometer ssh   
     1309             !                                         ! ---------------------------------------- !    
     1310             IF( kt == nit000 ) THEN                   !   set the forcing field at nit000 - 1    !    
     1311                !                                      ! ---------------------------------------- !    
     1312                !* Restart: read in restart file    
     1313                IF( ln_rstart .AND. iom_varid( numror, 'ssh_ibb', ldstop = .FALSE. ) > 0 ) THEN    
     1314                   IF(lwp) WRITE(numout,*) 'sbc_cpl:   ssh_ibb read in the restart file'    
     1315                   CALL iom_get( numror, jpdom_autoglo, 'ssh_ibb', ssh_ibb )   ! before inv. barometer ssh    
     1316                ELSE                                         !* no restart: set from nit000 values    
     1317                   IF(lwp) WRITE(numout,*) 'sbc_cpl:   ssh_ibb set to nit000 values'    
     1318                   ssh_ibb(:,:) = ssh_ib(:,:)    
     1319                ENDIF    
     1320             ENDIF    
     1321             !                                         ! ---------------------------------------- !    
     1322             IF( lrst_oce ) THEN                       !      Write in the ocean restart file     !    
     1323                !                                      ! ---------------------------------------- !    
     1324                IF(lwp) WRITE(numout,*)    
     1325                IF(lwp) WRITE(numout,*) 'sbc_cpl : ssh_ib written in ocean restart file at it= ', kt,' date= ', ndastp    
     1326                IF(lwp) WRITE(numout,*) '~~~~'    
     1327                CALL iom_rstput( kt, nitrst, numrow, 'ssh_ibb' , ssh_ib )    
     1328             ENDIF    
     1329           ENDIF   
     1330         
     1331           ! Update mean ssh    
     1332           IF( nn_components /= jp_iam_sas ) CALL sbc_ssm_cpl( kt ) 
    13031333      END IF  
    13041334      ! 
Note: See TracChangeset for help on using the changeset viewer.