Changeset 12303


Ignore:
Timestamp:
2020-01-07T15:42:06+01:00 (3 weeks ago)
Author:
kingr
Message:

Precalculate ht_n and use when applying SSH increment.

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

Legend:

Unmodified
Added
Removed
  • branches/UKMO/AMM15_v3_6_STABLE_package_collate_IAUtest/NEMOGCM/NEMO/OPA_SRC/DYN/sshwzv.F90

    r9178 r12303  
    7676      INTEGER             ::   ji, jj, jk              ! dummy loop indices 
    7777      REAL(wp)            ::   z2dt, z1_rau0           ! local scalars 
     78      REAL(wp), DIMENSION(jpi,jpj) :: ht_n 
     79      REAL(wp), DIMENSION(:,:)  , POINTER       ::   ztim     ! local array 
    7880      !!---------------------------------------------------------------------- 
    7981      ! 
     
    102104! Don't directly adjust ssh but change hdivn at all levels instead 
    103105! In trasbc also add in the heat and salt content associated with these changes at each level   
     106 
     107        ht_n(:,:) = fse3t_n(:,:,1) * tmask(:,:,1) 
     108        DO jk = 2, jpkm1 
     109           ht_n(:,:) = ht_n(:,:) + fse3t_n(:,:,jk) * tmask(:,:,jk) 
     110        END DO 
     111 
     112        ALLOCATE( ztim(jpi,jpj) ) 
     113        ztim(:,:) = ssh_iau(:,:) / ( ht_n(:,:) + 1.0 - ssmask(:,:) ) 
    104114        DO jk = 1, jpkm1                                  
    105                  hdivn(:,:,jk) = hdivn(:,:,jk) - ( ssh_iau(:,:) / ( ht_0(:,:) + 1.0 - ssmask(:,:) ) ) * ( e3t_0(:,:,jk) / fse3t_n(:,:,jk) ) * tmask(:,:,jk)  
     115                 hdivn(:,:,jk) = hdivn(:,:,jk) - ztim(:,:) * tmask(:,:,jk)  
    106116        END DO 
     117        DEALLOCATE(ztim) 
    107118        CALL lbc_lnk( hdivn, 'T', 1. ) ! Not sure that's necessary 
    108119      ENDIF 
  • branches/UKMO/AMM15_v3_6_STABLE_package_collate_IAUtest/NEMOGCM/NEMO/OPA_SRC/TRA/trasbc.F90

    r9178 r12303  
    124124      REAL(wp) ::   zfact, z1_e3t, zdep 
    125125      REAL(wp) ::   zalpha, zhk 
     126      REAL(wp), DIMENSION(jpi,jpj) :: ht_n 
    126127      REAL(wp), POINTER, DIMENSION(:,:,:) ::  ztrdt, ztrds 
    127128      !!---------------------------------------------------------------------- 
     
    288289! Contribution to tsa should be rate of change in level / per m of ocean? (hence the division by fse3t_n) 
    289290      IF( ln_sshinc ) THEN         ! input of heat and salt due to assimilation 
     291 
     292         ht_n(:,:) = fse3t_n(:,:,1) * tmask(:,:,1) 
     293         DO jk = 2, jpkm1 
     294            ht_n(:,:) = ht_n(:,:) + fse3t_n(:,:,jk) * tmask(:,:,jk) 
     295         END DO 
     296          
    290297         DO jj = 2, jpj  
    291298            DO ji = fs_2, fs_jpim1 
    292                zdep = ssh_iau(ji,jj) / ( ht_0(ji,jj) + 1.0 - ssmask(ji, jj) ) 
    293                DO jk = 1, jpkm1 
    294                   tsa(ji,jj,jk,jp_tem) = tsa(ji,jj,jk,jp_tem)   & 
    295                                         &            + tsn(ji,jj,jk,jp_tem) * zdep * ( e3t_0(ji,jj,jk) / fse3t_n(ji,jj,jk) ) 
    296                   tsa(ji,jj,jk,jp_sal) = tsa(ji,jj,jk,jp_sal)   & 
    297                                         &            + tsn(ji,jj,jk,jp_sal) * zdep * ( e3t_0(ji,jj,jk) / fse3t_n(ji,jj,jk) ) 
    298                END DO 
     299               zdep = ssh_iau(ji,jj) / ( ht_n(ji,jj) + 1.0 - ssmask(ji, jj) ) 
     300                  tsa(ji,jj,:,jp_tem) = tsa(ji,jj,:,jp_tem)   & 
     301                                        &            + tsn(ji,jj,:,jp_tem) * zdep 
     302                  tsa(ji,jj,:,jp_sal) = tsa(ji,jj,:,jp_sal)   & 
     303                                        &            + tsn(ji,jj,:,jp_sal) * zdep 
    299304            END DO   
    300305         END DO   
Note: See TracChangeset for help on using the changeset viewer.