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

Changeset 3785


Ignore:
Timestamp:
2013-02-10T08:53:27+01:00 (11 years ago)
Author:
gm
Message:

dev_MERGE_2012: #1051 : bug correction to compile LIM3 with ASM and with ICB

Location:
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/OPA_SRC
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/OPA_SRC/ASM/asminc.F90

    r3764 r3785  
    1414 
    1515   !!---------------------------------------------------------------------- 
    16    !!   'key_asminc' : Switch on the assimilation increment interface 
     16   !!   'key_asminc'   : Switch on the assimilation increment interface 
    1717   !!---------------------------------------------------------------------- 
    18    !!   asm_inc_init : Initialize the increment arrays and IAU weights 
    19    !!   calc_date    : Compute the calendar date YYYYMMDD on a given step 
    20    !!   tra_asm_inc  : Apply the tracer (T and S) increments 
    21    !!   dyn_asm_inc  : Apply the dynamic (u and v) increments 
    22    !!   ssh_asm_inc  : Apply the SSH increment 
    23    !!   seaice_asm_inc  : Apply the seaice increment 
     18   !!   asm_inc_init   : Initialize the increment arrays and IAU weights 
     19   !!   calc_date      : Compute the calendar date YYYYMMDD on a given step 
     20   !!   tra_asm_inc    : Apply the tracer (T and S) increments 
     21   !!   dyn_asm_inc    : Apply the dynamic (u and v) increments 
     22   !!   ssh_asm_inc    : Apply the SSH increment 
     23   !!   seaice_asm_inc : Apply the seaice increment 
    2424   !!---------------------------------------------------------------------- 
    2525   USE wrk_nemo         ! Memory Allocation 
    2626   USE par_oce          ! Ocean space and time domain variables 
    2727   USE dom_oce          ! Ocean space and time domain 
     28   USE domvvl           ! domain: variable volume level 
    2829   USE oce              ! Dynamics and active tracers defined in memory 
    2930   USE ldfdyn_oce       ! ocean dynamics: lateral physics 
     
    3536   USE in_out_manager   ! I/O manager 
    3637   USE lib_mpp          ! MPP library 
    37 #if defined key_lim3 
    38    USE ice              ! LIM3 
    39 #endif 
    4038#if defined key_lim2 
    4139   USE ice_2            ! LIM2 
    4240#endif 
    4341   USE sbc_oce          ! Surface boundary condition variables. 
    44    USE domvvl 
    4542 
    4643   IMPLICIT NONE 
     
    9592#  include "ldfdyn_substitute.h90" 
    9693#  include "vectopt_loop_substitute.h90" 
    97  
    9894   !!---------------------------------------------------------------------- 
    9995   !! NEMO/OPA 3.3 , NEMO Consortium (2010) 
     
    113109      !! ** Action  :  
    114110      !!---------------------------------------------------------------------- 
    115       !! 
    116       !! 
    117       INTEGER :: ji,jj,jk 
     111      INTEGER :: ji, jj, jk 
    118112      INTEGER :: jt 
    119113      INTEGER :: imid 
     
    961955   END SUBROUTINE ssh_asm_inc 
    962956 
     957 
    963958   SUBROUTINE seaice_asm_inc( kt, kindic ) 
    964959      !!---------------------------------------------------------------------- 
     
    971966      !! ** Action  :  
    972967      !! 
    973       !! History : 
    974       !!        !  07-2011  (D. Lea)  Initial version based on ssh_asm_inc 
    975       !!---------------------------------------------------------------------- 
    976  
     968      !!---------------------------------------------------------------------- 
    977969      IMPLICIT NONE 
    978  
    979       !! * Arguments 
    980       INTEGER, INTENT(IN) :: kt   ! Current time step 
    981       INTEGER, OPTIONAL, INTENT(IN) :: kindic ! flag for disabling the deallocation 
    982  
    983       !! * Local declarations 
    984       INTEGER :: it 
    985       REAL(wp) :: zincwgt  ! IAU weight for current time step 
    986  
    987 #if defined key_lim3 || defined key_lim2 
    988       REAL(wp), DIMENSION(jpi,jpj) :: zofrld, zohicif, zseaicendg, zhicifinc  ! LIM 
    989       REAL(wp) :: zhicifmin=0.5_wp      ! ice minimum depth in metres 
    990  
    991 #endif 
    992  
     970      ! 
     971      INTEGER, INTENT(in)           ::   kt   ! Current time step 
     972      INTEGER, INTENT(in), OPTIONAL ::   kindic   ! flag for disabling the deallocation 
     973      ! 
     974      INTEGER  ::   it 
     975      REAL(wp) ::   zincwgt   ! IAU weight for current time step 
     976#if defined key_lim2 
     977      REAL(wp), DIMENSION(jpi,jpj) ::   zofrld, zohicif, zseaicendg, zhicifinc  ! LIM 
     978      REAL(wp) ::   zhicifmin = 0.5_wp      ! ice minimum depth in metres 
     979#endif 
     980      !!---------------------------------------------------------------------- 
    993981 
    994982      IF ( ln_asmiau ) THEN 
     
    1011999            ENDIF 
    10121000 
    1013 #if defined key_lim3 || defined key_lim2 
    1014  
    1015             zofrld(:,:)=frld(:,:) 
    1016             zohicif(:,:)=hicif(:,:) 
    1017  
    1018             frld = MIN( MAX( frld(:,:) - seaice_bkginc(:,:) * zincwgt, 0.0_wp), 1.0_wp) 
     1001            ! Sea-ice : LIM-3 case (to add) 
     1002 
     1003#if defined key_lim2 
     1004            ! Sea-ice : LIM-2 case 
     1005            zofrld (:,:) = frld(:,:) 
     1006            zohicif(:,:) = hicif(:,:) 
     1007            ! 
     1008            frld  = MIN( MAX( frld (:,:) - seaice_bkginc(:,:) * zincwgt, 0.0_wp), 1.0_wp) 
    10191009            pfrld = MIN( MAX( pfrld(:,:) - seaice_bkginc(:,:) * zincwgt, 0.0_wp), 1.0_wp) 
    10201010            fr_i(:,:) = 1.0_wp - frld(:,:)        ! adjust ice fraction 
    1021  
    1022             zseaicendg(:,:)=zofrld(:,:) - frld(:,:)         ! find out actual sea ice nudge applied 
    1023  
     1011            ! 
     1012            zseaicendg(:,:) = zofrld(:,:) - frld(:,:)   ! find out actual sea ice nudge applied 
     1013            ! 
    10241014            ! Nudge sea ice depth to bring it up to a required minimum depth 
    1025  
    10261015            WHERE( zseaicendg(:,:) > 0.0_wp .AND. hicif(:,:) < zhicifmin )  
    10271016               zhicifinc(:,:) = (zhicifmin - hicif(:,:)) * zincwgt     
     
    10291018               zhicifinc(:,:) = 0.0_wp 
    10301019            END WHERE 
    1031  
    1032 ! nudge ice depth 
    1033             hicif(:,:)=hicif(:,:) + zhicifinc(:,:) 
    1034             phicif(:,:)=phicif(:,:) + zhicifinc(:,:)        
    1035  
    1036 ! seaice salinity balancing (to add) 
    1037  
     1020            ! 
     1021            ! nudge ice depth 
     1022            hicif (:,:) = hicif (:,:) + zhicifinc(:,:) 
     1023            phicif(:,:) = phicif(:,:) + zhicifinc(:,:)        
     1024            ! 
     1025            ! seaice salinity balancing (to add) 
    10381026#endif 
    10391027 
    10401028#if defined key_cice 
    1041  
    1042 ! Pass ice increment tendency into CICE 
     1029            ! Sea-ice : CICE case. Pass ice increment tendency into CICE 
    10431030            ndaice_da(:,:) = seaice_bkginc(:,:) * zincwgt / rdt 
    1044  
    10451031#endif 
    10461032 
     
    10521038 
    10531039#if defined key_cice 
    1054  
    1055 ! Zero ice increment tendency into CICE 
     1040            ! Sea-ice : CICE case. Zero ice increment tendency into CICE 
    10561041            ndaice_da(:,:) = 0.0_wp 
    1057  
    10581042#endif 
    10591043 
     
    10701054            neuler = 0                    ! Force Euler forward step 
    10711055 
    1072 #if defined key_lim3 || defined key_lim2 
    1073  
     1056            ! Sea-ice : LIM-3 case (to add) 
     1057 
     1058#if defined key_lim2 
     1059            ! Sea-ice : LIM-2 case. 
    10741060            zofrld(:,:)=frld(:,:) 
    10751061            zohicif(:,:)=hicif(:,:) 
    1076   
     1062            !  
    10771063            ! Initialize the now fields the background + increment 
    1078  
    1079             frld(:,:) = MIN( MAX( frld(:,:) - seaice_bkginc(:,:), 0.0_wp), 1.0_wp) 
     1064            frld (:,:) = MIN( MAX( frld(:,:) - seaice_bkginc(:,:), 0.0_wp), 1.0_wp) 
    10801065            pfrld(:,:) = frld(:,:)  
    1081             fr_i(:,:) = 1.0_wp - frld(:,:)        ! adjust ice fraction 
    1082  
    1083             zseaicendg(:,:)=zofrld(:,:) - frld(:,:)         ! find out actual sea ice nudge applied 
    1084  
     1066            fr_i (:,:) = 1.0_wp - frld(:,:)                ! adjust ice fraction 
     1067            zseaicendg(:,:) = zofrld(:,:) - frld(:,:)      ! find out actual sea ice nudge applied 
     1068            ! 
    10851069            ! Nudge sea ice depth to bring it up to a required minimum depth 
    1086  
    10871070            WHERE( zseaicendg(:,:) > 0.0_wp .AND. hicif(:,:) < zhicifmin )  
    10881071               zhicifinc(:,:) = (zhicifmin - hicif(:,:)) * zincwgt     
     
    10901073               zhicifinc(:,:) = 0.0_wp 
    10911074            END WHERE 
    1092  
    1093 ! nudge ice depth 
    1094             hicif(:,:)=hicif(:,:) + zhicifinc(:,:) 
    1095             phicif(:,:)=phicif(:,:)        
    1096  
    1097 ! seaice salinity balancing (to add) 
    1098    
     1075            ! 
     1076            ! nudge ice depth 
     1077            hicif (:,:) = hicif (:,:) + zhicifinc(:,:) 
     1078            phicif(:,:) = phicif(:,:)        
     1079            ! 
     1080            ! seaice salinity balancing (to add) 
    10991081#endif 
    11001082  
    11011083#if defined key_cice 
    1102  
    1103 ! Pass ice increment tendency into CICE - is this correct? 
     1084            ! Sea-ice : CICE case. Pass ice increment tendency into CICE - is this correct? 
    11041085           ndaice_da(:,:) = seaice_bkginc(:,:) / rdt 
    1105  
    11061086#endif 
    11071087           IF ( .NOT. PRESENT(kindic) ) THEN 
     
    11121092 
    11131093#if defined key_cice 
    1114  
    1115 ! Zero ice increment tendency into CICE  
     1094            ! Sea-ice : CICE case. Zero ice increment tendency into CICE  
    11161095            ndaice_da(:,:) = 0.0_wp 
    1117  
    11181096#endif 
    11191097          
    11201098         ENDIF 
    11211099 
    1122 !#if defined key_lim3 || defined key_lim2 || defined key_cice 
     1100!#if defined defined key_lim2 || defined key_cice 
    11231101! 
    11241102!            IF (ln_seaicebal ) THEN        
     
    11951173!#endif 
    11961174 
    1197  
    11981175      ENDIF 
    11991176 
    12001177   END SUBROUTINE seaice_asm_inc 
     1178    
    12011179   !!====================================================================== 
    12021180END MODULE asminc 
  • branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/OPA_SRC/ICB/icbini.F90

    r3614 r3785  
    11MODULE icbini 
    2  
    32   !!====================================================================== 
    43   !!                       ***  MODULE  icbini  *** 
     
    1918   USE in_out_manager ! IO routines and numout in particular 
    2019   USE lib_mpp        ! mpi library and lk_mpp in particular 
    21    USE sbc_oce        ! ocean: surface boundary condition 
     20   USE sbc_oce        ! ocean  : surface boundary condition 
     21   USE sbc_ice        ! sea-ice: surface boundary condition 
    2222   USE iom            ! IOM library 
    2323   USE fldread        ! field read 
     
    267267   END SUBROUTINE icb_init 
    268268 
     269 
    269270   SUBROUTINE icb_ini_gen() 
    270271      !!---------------------------------------------------------------------- 
     
    333334   END SUBROUTINE icb_ini_gen 
    334335 
     336 
    335337   SUBROUTINE icb_nam 
    336338      !!---------------------------------------------------------------------- 
     
    377379      IF( zfact < 1._wp ) THEN 
    378380         IF( zfact <= 0._wp ) THEN 
    379             CALL ctl_stop( 'icb_nam: sum of berg distribution equal to zero' ) 
     381             
    380382         ELSE 
    381383            rn_distribution(:) = rn_distribution(:) / zfact 
    382384            CALL ctl_warn( 'icb_nam: sum of berg input distribution not equal to one and so RESCALED' ) 
    383385         ENDIF 
     386      ENDIF 
     387 
     388      IF( lk_lim3 .AND. ln_icebergs ) THEN 
     389         CALL ctl_stop( 'icb_nam: the use of ICB with LIM3 not allowed. ice thickness missing in ICB' ) 
    384390      ENDIF 
    385391 
     
    430436 
    431437   !!====================================================================== 
    432  
    433438END MODULE icbini 
  • branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/OPA_SRC/ICB/icbutl.F90

    r3614 r3785  
    11MODULE icbutl 
    2  
    32   !!====================================================================== 
    43   !!                       ***  MODULE  icbutl  *** 
     
    139138      puo  = icb_utl_bilin_h( uo_e, pi, pj, 'U' )             ! ocean velocities 
    140139      pvo  = icb_utl_bilin_h( vo_e, pi, pj, 'V' ) 
    141       psst = icb_utl_bilin( sst_m, pi, pj, 'T' )            ! SST 
    142       pcn  = icb_utl_bilin( fr_i , pi, pj, 'T' )            ! ice concentration 
     140      psst = icb_utl_bilin( sst_m, pi, pj, 'T' )              ! SST 
     141      pcn  = icb_utl_bilin( fr_i , pi, pj, 'T' )              ! ice concentration 
    143142      pff  = icb_utl_bilin_h( ff_e , pi, pj, 'F' )            ! Coriolis parameter 
    144143      ! 
     
    153152      pui = icb_utl_bilin_h( ui_e, pi, pj, 'U' )              ! sea-ice velocities 
    154153      pvi = icb_utl_bilin_h( vi_e, pi, pj, 'V' ) 
    155       phi = icb_utl_bilin(hicif, pi, pj, 'T' )              ! ice thickness 
     154# if defined key_lim3 
     155      phi = 0._wp                                             ! LIM-3 case (to do) 
     156# else 
     157      phi = icb_utl_bilin(hicif, pi, pj, 'T' )                ! ice thickness 
     158# endif 
    156159#else 
    157160      pui = 0._wp 
Note: See TracChangeset for help on using the changeset viewer.