Ignore:
Timestamp:
Feb 16, 2015, 8:34:28 AM (10 years ago)
Author:
Ehouarn Millour
Message:

Update of the slab ocean by Francis Codron. There are now 3 possibilities for the "version_ocean" slab type:
sicOBS = prescribed ice fraction. Water temperature nearby is set to -1.8°C and cannot become lower.
sicNO = ignore sea ice. One can prescribe a fraction, but the nearby ocean evolves freely, depending on surface fluxes: temperature can go below freezing point or above...
sicINT = interactive sea ice.
EM

File:
1 edited

Legend:

Unmodified
Added
Removed
  • LMDZ5/trunk/libf/phylmd/limit_slab.F90

    r2057 r2209  
    11! $Header$
    22
    3 SUBROUTINE limit_slab(itime, dtime, jour, lmt_bils, diff_sst)
     3SUBROUTINE limit_slab(itime, dtime, jour, lmt_bils, diff_sst, diff_siv)
    44
    55  USE dimphy
     
    2020  INTEGER, INTENT(IN) :: jour    ! jour a lire dans l'annee
    2121  REAL   , INTENT(IN) :: dtime   ! pas de temps de la physique (en s)
    22   REAL, DIMENSION(klon), INTENT(OUT) :: lmt_bils, diff_sst
     22  REAL, DIMENSION(klon), INTENT(OUT) :: lmt_bils, diff_sst, diff_siv
    2323
    2424! Locals variables with attribute SAVE
    2525!****************************************************************************************
    2626  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: bils_save, diff_sst_save
    27 !$OMP THREADPRIVATE(bils_save, diff_sst_save)
     27  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: diff_siv_save
     28!$OMP THREADPRIVATE(bils_save, diff_sst_save, diff_siv_save)
    2829
    2930! Locals variables
     
    3334  INTEGER, DIMENSION(2)    :: start, epais
    3435  REAL, DIMENSION(klon_glo):: bils_glo, sst_l_glo, sst_lp1_glo, diff_sst_glo
     36  REAL, DIMENSION(klon_glo):: siv_l_glo, siv_lp1_glo, diff_siv_glo
    3537  CHARACTER (len = 20)     :: modname = 'limit_slab'
    36   LOGICAL                  :: read_bils,read_sst
     38  LOGICAL                  :: read_bils,read_sst,read_siv
    3739
    3840! End declaration
     
    4951        read_bils=.TRUE.
    5052        read_sst=.TRUE.
     53        read_siv=.TRUE.
    5154       
    5255        ierr = NF90_OPEN ('limit_slab.nc', NF90_NOWRITE, nid)
     
    5457            read_bils=.FALSE.
    5558            read_sst=.FALSE.
     59            read_siv=.FALSE.
    5660        ELSE ! read file
    5761       
     
    6367
    6468!****************************************************************************************
    65 ! 2) Read bils and SST tendency
     69! 2) Read bils and SST/ ice volume tendency
    6670!
    6771!****************************************************************************************
     
    8993        END IF
    9094
     95! Read siv_glo for this day
     96        ierr = NF90_INQ_VARID(nid, 'SICV', nvarid)
     97        IF (ierr /= NF90_NOERR)  THEN
     98            read_siv=.FALSE.
     99        ELSE
     100            start(2) = jour
     101            ierr = NF90_GET_VAR(nid,nvarid,siv_l_glo,start,epais)
     102            IF (ierr /= NF90_NOERR) read_siv=.FALSE.
     103! Read siv_glo for one day ahead
     104            start(2) = jour + 1
     105            IF (start(2) > 360) start(2)=1
     106            ierr = NF90_GET_VAR(nid,nvarid,siv_lp1_glo,start,epais)
     107            IF (ierr /= NF90_NOERR) read_siv=.FALSE.
     108        END IF
     109
    91110!****************************************************************************************
    92111! 5) Close file and distribute variables to all processus
     
    98117        IF (read_sst) THEN
    99118! Calculate difference in temperature between this day and one ahead
    100 !            DO i=1, klon_glo-1
    101 !               diff_sst_glo(i) = sst_lp1_glo(i) - sst_l_glo(i)
    102 !            END DO
    103 !            diff_sst_glo(klon_glo) = sst_lp1_glo(klon_glo) - sst_l_glo(1)
    104119            DO i=1, klon_glo
    105120               diff_sst_glo(i) = sst_lp1_glo(i) - sst_l_glo(i)
    106121            END DO
    107122        END IF !read_sst
     123        IF (read_siv) THEN
     124! Calculate difference in temperature between this day and one ahead
     125            DO i=1, klon_glo
     126               diff_siv_glo(i) = siv_lp1_glo(i) - siv_l_glo(i)
     127            END DO
     128        END IF !read_siv
    108129     ENDIF ! is_mpi_root
    109130
     
    111132       
    112133     IF (.NOT. ALLOCATED(bils_save)) THEN
    113         ALLOCATE(bils_save(klon), diff_sst_save(klon), stat=ierr)
     134        ALLOCATE(bils_save(klon), diff_sst_save(klon), diff_siv_save(klon), stat=ierr)
    114135        IF (ierr /= 0) CALL abort_gcm('limit_slab', 'pb in allocation',1)
    115136     END IF
    116137
    117 ! Giveddefault values if needed
     138! Give default values if needed
    118139     IF (read_bils) THEN
    119140         CALL Scatter(bils_glo, bils_save)
     
    126147         diff_sst_save(:)=0.
    127148     END IF
     149     IF (read_siv) THEN
     150         CALL Scatter(diff_siv_glo, diff_siv_save)
     151     ELSE
     152         diff_siv_save(:)=0.
     153     END IF
    128154     
    129155  ENDIF ! time to read
     
    131157  lmt_bils(:) = bils_save(:)
    132158  diff_sst(:) = diff_sst_save(:)
     159  diff_siv(:) = diff_siv_save(:)
     160
    133161 
    134162END SUBROUTINE limit_slab
Note: See TracChangeset for help on using the changeset viewer.