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 7761 for trunk/NEMOGCM/NEMO/OPA_SRC – NEMO

Ignore:
Timestamp:
2017-03-06T18:58:35+01:00 (7 years ago)
Author:
clem
Message:

make AGRIF and LIM3 fully compatible

Location:
trunk/NEMOGCM/NEMO/OPA_SRC
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/NEMOGCM/NEMO/OPA_SRC/DOM/phycst.F90

    r7646 r7761  
    4040   REAL(wp), PUBLIC ::   rtt      = 273.16_wp        !: triple point of temperature   [Kelvin] 
    4141   REAL(wp), PUBLIC ::   rt0      = 273.15_wp        !: freezing point of fresh water [Kelvin] 
     42   REAL(wp), PUBLIC ::   rt0_snow = 273.15_wp        !: melting point of snow         [Kelvin] 
    4243#if defined key_lim3 
    43    REAL(wp), PUBLIC ::   rt0_snow = 273.15_wp        !: melting point of snow         [Kelvin] 
    4444   REAL(wp), PUBLIC ::   rt0_ice  = 273.15_wp        !: melting point of ice          [Kelvin] 
    4545#else 
    46    REAL(wp), PUBLIC ::   rt0_snow = 273.15_wp        !: melting point of snow         [Kelvin] 
    4746   REAL(wp), PUBLIC ::   rt0_ice  = 273.05_wp        !: melting point of ice          [Kelvin] 
    4847#endif 
  • trunk/NEMOGCM/NEMO/OPA_SRC/DYN/dynhpg.F90

    r7753 r7761  
    13301330      jpi   = size(fsp,1) 
    13311331      jpj   = size(fsp,2) 
    1332       jpkm1 = size(fsp,3) - 1 
     1332      jpkm1 = MAX( 1, size(fsp,3) - 1 ) 
    13331333      ! 
    13341334      IF (polynomial_type == 1) THEN     ! Constrained Cubic Spline 
  • trunk/NEMOGCM/NEMO/OPA_SRC/SBC/sbccpl.F90

    r7646 r7761  
    15901590         zemp_tot(:,:) =   frcv(jpr_tevp)%z3(:,:,1) - ztprecip(:,:) 
    15911591         zemp_ice(:,:) = ( frcv(jpr_ievp)%z3(:,:,1) - frcv(jpr_snow)%z3(:,:,1) ) * zicefr(:,:) 
    1592                CALL iom_put( 'rain'         ,   frcv(jpr_rain)%z3(:,:,1)                                                         )  ! liquid precipitation  
     1592         IF( iom_use('precip') )          & 
     1593            &  CALL iom_put( 'precip'       ,   frcv(jpr_rain)%z3(:,:,1) + frcv(jpr_snow)%z3(:,:,1)                              )  ! total  precipitation 
     1594         IF( iom_use('rain') )            & 
     1595            &  CALL iom_put( 'rain'         ,   frcv(jpr_rain)%z3(:,:,1)                                                         )  ! liquid precipitation  
     1596         IF( iom_use('rain_ao_cea') )   & 
     1597            &  CALL iom_put( 'rain_ao_cea'  , frcv(jpr_rain)%z3(:,:,1)* p_frld(:,:) * tmask(:,:,1)      )   ! liquid precipitation  
    15931598         IF( iom_use('hflx_rain_cea') )   & 
    1594             &  CALL iom_put( 'hflx_rain_cea',   frcv(jpr_rain)%z3(:,:,1) * zcptn(:,:)                                            )  ! heat flux from liq. precip.  
     1599            CALL iom_put( 'hflx_rain_cea', frcv(jpr_rain)%z3(:,:,1) * zcptn(:,:) * tmask(:,:,1))   ! heat flux from liq. precip.  
     1600         IF( iom_use('hflx_prec_cea') )   & 
     1601            CALL iom_put( 'hflx_prec_cea', ztprecip * zcptn(:,:) * tmask(:,:,1) * p_frld(:,:) )   ! heat content flux from all precip  (cell avg) 
     1602         IF( iom_use('evap_ao_cea') .OR. iom_use('hflx_evap_cea') )   & 
     1603            ztmp(:,:) = frcv(jpr_tevp)%z3(:,:,1) - frcv(jpr_ievp)%z3(:,:,1) * zicefr(:,:) 
    15951604         IF( iom_use('evap_ao_cea'  ) )   & 
    1596             &  CALL iom_put( 'evap_ao_cea'  ,   frcv(jpr_tevp)%z3(:,:,1) - frcv(jpr_ievp)%z3(:,:,1) * zicefr(:,:)                )  ! ice-free oce evap (cell average) 
     1605            CALL iom_put( 'evap_ao_cea'  , ztmp * tmask(:,:,1)                  )   ! ice-free oce evap (cell average) 
    15971606         IF( iom_use('hflx_evap_cea') )   & 
    1598             &  CALL iom_put( 'hflx_evap_cea', ( frcv(jpr_tevp)%z3(:,:,1) - frcv(jpr_ievp)%z3(:,:,1) * zicefr(:,:) ) * zcptn(:,:) )  ! heat flux from from evap (cell average) 
    1599       CASE( 'oce and ice' )   ! received fields: jpr_sbpr, jpr_semp, jpr_oemp, jpr_ievp 
     1607            CALL iom_put( 'hflx_evap_cea', ztmp(:,:) * zcptn(:,:) * tmask(:,:,1) )   ! heat flux from from evap (cell average) 
     1608      CASE( 'oce and ice'   )   ! received fields: jpr_sbpr, jpr_semp, jpr_oemp, jpr_ievp 
    16001609         zemp_tot(:,:) = p_frld(:,:) * frcv(jpr_oemp)%z3(:,:,1) + zicefr(:,:) * frcv(jpr_sbpr)%z3(:,:,1) 
    16011610         zemp_ice(:,:) = frcv(jpr_semp)%z3(:,:,1) * zicefr(:,:) 
     
    16601669      ! runoffs and calving (put in emp_tot) 
    16611670      IF( srcv(jpr_rnf)%laction )   rnf(:,:) = frcv(jpr_rnf)%z3(:,:,1) 
     1671      IF( iom_use('hflx_rnf_cea') )   & 
     1672         CALL iom_put( 'hflx_rnf_cea' , rnf(:,:) * zcptn(:,:) ) 
    16621673      IF( srcv(jpr_cal)%laction ) THEN  
    16631674         zemp_tot(:,:) = zemp_tot(:,:) - frcv(jpr_cal)%z3(:,:,1) 
  • trunk/NEMOGCM/NEMO/OPA_SRC/SBC/sbcice_lim.F90

    r7753 r7761  
    116116      IF( nn_timing == 1 )   CALL timing_start('sbc_ice_lim') 
    117117 
    118       ! clem: it is important to initialize agrif_lim3 variables here and not in sbc_lim_init 
    119 # if defined key_agrif 
    120       IF( kt == nit000 ) THEN 
    121          IF( .NOT. Agrif_Root() )   CALL Agrif_InitValues_cont_lim3 
    122       ENDIF 
    123 # endif 
    124  
    125118      !-----------------------! 
    126119      ! --- Ice time step --- ! 
     
    194187         IF( .NOT. Agrif_Root() )     CALL agrif_interp_lim3('T') 
    195188#endif 
    196          IF( ln_limthd .AND. ln_bdy )     CALL bdy_ice_lim( kt )   ! -- bdy ice thermo  
     189         IF( ln_limthd .AND. ln_bdy ) CALL bdy_ice_lim( kt )   ! -- bdy ice thermo  
    197190         ! previous lead fraction and ice volume for flux calculations 
    198191                                      CALL sbc_lim_bef                         
     
    246239                                      CALL lim_var_agg( 2 )     ! necessary calls (at least for coupling) 
    247240                                      ! 
    248 # if defined key_agrif 
    249 !!         IF( .NOT. Agrif_Root() )     CALL Agrif_ChildGrid_To_ParentGrid()  ! clem: should be called at the update frequency only (cf agrif_lim3_update) 
    250 # endif 
     241!! clem: one should switch the calculation of the fluxes onto the parent grid but the following calls do not work 
     242!!       moreover it should only be called at the update frequency (as in agrif_lim3_update.F90) 
     243!!# if defined key_agrif 
     244!!         IF( .NOT. Agrif_Root() )   CALL Agrif_ChildGrid_To_ParentGrid() 
     245!!# endif 
    251246                                      CALL lim_sbc_flx( kt )    ! -- Update surface ocean mass, heat and salt fluxes 
    252 # if defined key_agrif 
    253 !!         IF( .NOT. Agrif_Root() )     CALL Agrif_ParentGrid_To_ChildGrid()  ! clem: should be called at the update frequency only (cf agrif_lim3_update) 
    254 # endif 
     247!!# if defined key_agrif 
     248!!         IF( .NOT. Agrif_Root() )   CALL Agrif_ParentGrid_To_ChildGrid() 
     249!!# endif 
    255250         IF( ln_limdiahsb )           CALL lim_diahsb( kt )     ! -- Diagnostics and outputs  
    256251         ! 
     
    425420      ! 
    426421      IF( lwp .AND. ln_bdy .AND. ln_limdiachk )  & 
    427       &   CALL ctl_warn('online conservation check activated but it does not work with BDY') 
     422         &   CALL ctl_warn('online conservation check activated but it does not work with BDY') 
    428423      ! 
    429424      IF( lwp ) WRITE(numout,*) '   ice timestep rdt_ice  = ', rdt_ice 
  • trunk/NEMOGCM/NEMO/OPA_SRC/nemogcm.F90

    r7646 r7761  
    376376      jpim1 = jpi-1                                            ! inner domain indices 
    377377      jpjm1 = jpj-1                                            !   "           " 
    378       jpkm1 = jpk-1                                            !   "           " 
     378      jpkm1 = MAX( 1, jpk-1 )                                  !   "           " 
    379379      jpij  = jpi*jpj                                          !  jpi x j 
    380380 
Note: See TracChangeset for help on using the changeset viewer.