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 7563 – NEMO

Changeset 7563


Ignore:
Timestamp:
2017-01-16T17:36:42+01:00 (7 years ago)
Author:
timgraham
Message:

Remove requirement for sali_ref_clim.nc file when key_diaar5 is set but thermosteric sea level variable is not requested
Requires MEDUSA branch r7543 to avoid a conflict

Location:
branches/UKMO/dev_r5518_GO6_package/NEMOGCM/NEMO/OPA_SRC
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/UKMO/dev_r5518_GO6_package/NEMOGCM/NEMO/OPA_SRC/DIA/diaar5.F90

    r7179 r7563  
    8686      !!-------------------------------------------------------------------- 
    8787      IF( nn_timing == 1 )   CALL timing_start('dia_ar5') 
     88 
     89      !Call to init moved to here so that we can call iom_use in the 
     90      !initialisation 
     91      IF( kt == nit000 )     CALL dia_ar5_init 
    8892  
    8993      CALL wrk_alloc( jpi , jpj              , zarea_ssh , zbotpres, pe ) 
     
    103107 
    104108      !                      
    105       IF( iom_use('sshthster') ) THEN 
    106       ztsn(:,:,:,jp_tem) = tsn(:,:,:,jp_tem)                    ! thermosteric ssh 
    107       ztsn(:,:,:,jp_sal) = sn0(:,:,:) 
    108       CALL eos( ztsn, zrhd, fsdept_n(:,:,:) )                       ! now in situ density using initial salinity 
    109       ! 
    110       zbotpres(:,:) = 0._wp                        ! no atmospheric surface pressure, levitating sea-ice 
    111       DO jk = 1, jpkm1 
    112          zbotpres(:,:) = zbotpres(:,:) + fse3t(:,:,jk) * zrhd(:,:,jk) 
    113       END DO 
    114       IF( .NOT.lk_vvl ) THEN 
    115          IF ( ln_isfcav ) THEN 
    116             DO ji=1,jpi 
    117                DO jj=1,jpj 
    118                   zbotpres(ji,jj) = zbotpres(ji,jj) + sshn(ji,jj) * zrhd(ji,jj,mikt(ji,jj)) + riceload(ji,jj) 
     109      IF( iom_use('sshthster')) THEN 
     110         ztsn(:,:,:,jp_tem) = tsn(:,:,:,jp_tem)                    ! thermosteric ssh 
     111         ztsn(:,:,:,jp_sal) = sn0(:,:,:) 
     112         CALL eos( ztsn, zrhd, fsdept_n(:,:,:) )                       ! now in situ density using initial salinity 
     113         ! 
     114         zbotpres(:,:) = 0._wp                        ! no atmospheric surface pressure, levitating sea-ice 
     115         DO jk = 1, jpkm1 
     116            zbotpres(:,:) = zbotpres(:,:) + fse3t(:,:,jk) * zrhd(:,:,jk) 
     117         END DO 
     118         IF( .NOT.lk_vvl ) THEN 
     119            IF ( ln_isfcav ) THEN 
     120               DO ji=1,jpi 
     121                  DO jj=1,jpj 
     122                     zbotpres(ji,jj) = zbotpres(ji,jj) + sshn(ji,jj) * zrhd(ji,jj,mikt(ji,jj)) + riceload(ji,jj) 
     123                  END DO 
    119124               END DO 
    120             END DO 
    121          ELSE 
    122             zbotpres(:,:) = zbotpres(:,:) + sshn(:,:) * zrhd(:,:,1) 
     125            ELSE 
     126               zbotpres(:,:) = zbotpres(:,:) + sshn(:,:) * zrhd(:,:,1) 
     127            END IF 
    123128         END IF 
    124       END IF 
     129      !                                          
     130         zarho = SUM( area(:,:) * zbotpres(:,:) )  
     131         IF( lk_mpp )   CALL mpp_sum( zarho ) 
     132         zssh_steric = - zarho / area_tot 
     133         CALL iom_put( 'sshthster', zssh_steric ) 
    125134      ENDIF 
    126       !                                          
    127       zarho = SUM( area(:,:) * zbotpres(:,:) )  
    128       IF( lk_mpp )   CALL mpp_sum( zarho ) 
    129       zssh_steric = - zarho / area_tot 
    130       CALL iom_put( 'sshthster', zssh_steric ) 
    131135       
    132136      !                                         ! steric sea surface height 
     
    274278      IF( lk_mpp )   CALL mpp_sum( vol0 ) 
    275279 
    276         CALL iom_open ( 'sali_ref_clim_monthly', inum ) 
    277         CALL iom_get  ( inum, jpdom_data, 'vosaline' , zsaldta(:,:,:,1), 1  ) 
    278         CALL iom_get  ( inum, jpdom_data, 'vosaline' , zsaldta(:,:,:,2), 12 ) 
    279         CALL iom_close( inum ) 
    280  
    281       sn0(:,:,:) = 0.5_wp * ( zsaldta(:,:,:,1) + zsaldta(:,:,:,2) )         
    282       sn0(:,:,:) = sn0(:,:,:) * tmask(:,:,:) 
    283       IF( ln_zps ) THEN               ! z-coord. partial steps 
    284          DO jj = 1, jpj               ! interpolation of salinity at the last ocean level (i.e. the partial step) 
    285             DO ji = 1, jpi 
    286                ik = mbkt(ji,jj) 
    287                IF( ik > 1 ) THEN 
    288                   zztmp = ( gdept_1d(ik) - gdept_0(ji,jj,ik) ) / ( gdept_1d(ik) - gdept_1d(ik-1) ) 
    289                   sn0(ji,jj,ik) = ( 1._wp - zztmp ) * sn0(ji,jj,ik) + zztmp * sn0(ji,jj,ik-1) 
    290                ENDIF 
     280      IF( iom_use('sshthster')) THEN 
     281         CALL iom_open ( 'sali_ref_clim_monthly', inum ) 
     282         CALL iom_get  ( inum, jpdom_data, 'vosaline' , zsaldta(:,:,:,1), 1  ) 
     283         CALL iom_get  ( inum, jpdom_data, 'vosaline' , zsaldta(:,:,:,2), 12 ) 
     284         CALL iom_close( inum ) 
     285 
     286         sn0(:,:,:) = 0.5_wp * ( zsaldta(:,:,:,1) + zsaldta(:,:,:,2) )         
     287         sn0(:,:,:) = sn0(:,:,:) * tmask(:,:,:) 
     288         IF( ln_zps ) THEN               ! z-coord. partial steps 
     289            DO jj = 1, jpj               ! interpolation of salinity at the last ocean level (i.e. the partial step) 
     290               DO ji = 1, jpi 
     291                  ik = mbkt(ji,jj) 
     292                  IF( ik > 1 ) THEN 
     293                     zztmp = ( gdept_1d(ik) - gdept_0(ji,jj,ik) ) / ( gdept_1d(ik) - gdept_1d(ik-1) ) 
     294                     sn0(ji,jj,ik) = ( 1._wp - zztmp ) * sn0(ji,jj,ik) + zztmp * sn0(ji,jj,ik-1) 
     295                  ENDIF 
     296               END DO 
    291297            END DO 
    292          END DO 
     298         ENDIF 
    293299      ENDIF 
    294300      ! 
  • branches/UKMO/dev_r5518_GO6_package/NEMOGCM/NEMO/OPA_SRC/nemogcm.F90

    r6487 r7563  
    462462      !                                     ! Diagnostics 
    463463      IF( lk_floats     )   CALL     flo_init   ! drifting Floats 
    464       IF( lk_diaar5     )   CALL dia_ar5_init   ! ar5 diag 
    465464                            CALL dia_ptr_init   ! Poleward TRansports initialization 
    466465      IF( lk_diadct     )   CALL dia_dct_init   ! Sections tranports 
Note: See TracChangeset for help on using the changeset viewer.