Ignore:
Timestamp:
Nov 21, 2019, 4:43:45 PM (4 years ago)
Author:
lguez
Message:

Merge revisions 3427:3600 of trunk into branch Ocean_skin

Location:
LMDZ6/branches/Ocean_skin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • LMDZ6/branches/Ocean_skin

  • LMDZ6/branches/Ocean_skin/libf/phylmd/phyetat0.F90

    r3458 r3605  
    99  USE pbl_surface_mod,  ONLY : pbl_surface_init
    1010  USE surface_data,     ONLY : type_ocean, version_ocean
    11   USE phys_state_var_mod, ONLY : ancien_ok, clwcon, detr_therm, dtime, &
     11  USE phys_state_var_mod, ONLY : ancien_ok, clwcon, detr_therm, phys_tstep, &
    1212       qsol, fevap, z0m, z0h, agesno, &
    1313       du_gwd_rando, du_gwd_front, entr_therm, f0, fm_therm, &
     
    111111  IF (carbon_cycle_tr .OR. carbon_cycle_cpl) THEN
    112112     co2_ppm = tab_cntrl(3)
    113      RCO2    = co2_ppm * 1.0e-06  * 44.011/28.97
     113     RCO2    = co2_ppm * 1.0e-06 * RMCO2 / RMD
    114114     ! ELSE : keep value from .def
    115   END IF
    116 
    117   ! co2_ppm0 : initial value of atmospheric CO2 (from create_etat0_limit.e .def)
    118   co2_ppm0   = tab_cntrl(16)
     115  ENDIF
     116
     117! co2_ppm0 : initial value of atmospheric CO2 (from create_etat0_limit.e .def)
     118! co2_ppm0   = tab_cntrl(16)
     119! initial value for interactive CO2 run when there is no tracer field for CO2 in restart
     120  co2_ppm0=284.32
    119121
    120122  solaire_etat0      = tab_cntrl(4)
     
    122124  tab_cntrl(6)=nbapp_rad
    123125
    124   if (iflag_cycle_diurne.GE.1) tab_cntrl( 7) = iflag_cycle_diurne
    125   if (soil_model) tab_cntrl( 8) =1.
    126   if (new_oliq) tab_cntrl( 9) =1.
    127   if (ok_orodr) tab_cntrl(10) =1.
    128   if (ok_orolf) tab_cntrl(11) =1.
    129   if (ok_limitvrai) tab_cntrl(12) =1.
     126  IF (iflag_cycle_diurne.GE.1) tab_cntrl( 7) = iflag_cycle_diurne
     127  IF (soil_model) tab_cntrl( 8) =1.
     128  IF (new_oliq) tab_cntrl( 9) =1.
     129  IF (ok_orodr) tab_cntrl(10) =1.
     130  IF (ok_orolf) tab_cntrl(11) =1.
     131  IF (ok_limitvrai) tab_cntrl(12) =1.
    130132
    131133  itau_phy = tab_cntrl(15)
     
    164166  DO i=1,klon
    165167    IF (ABS(lon_startphy(i)-longitude_deg(i))>=1) THEN
    166       WRITE(*,*) "phyetat0: Error! Longitude discrepancy wrt startphy file:",&
    167                  " i=",i," lon_startphy(i)=",lon_startphy(i),&
    168                  " longitude_deg(i)=",longitude_deg(i)
    169       ! This is presumably serious enough to abort run
    170       CALL abort_physic("phyetat0","discrepancy in longitudes!",1)
     168      IF (ABS(360-ABS(lon_startphy(i)-longitude_deg(i)))>=1) THEN
     169        WRITE(*,*) "phyetat0: Error! Longitude discrepancy wrt startphy file:",&
     170                   " i=",i," lon_startphy(i)=",lon_startphy(i),&
     171                   " longitude_deg(i)=",longitude_deg(i)
     172        ! This is presumably serious enough to abort run
     173        CALL abort_physic("phyetat0","discrepancy in longitudes!",1)
     174      ENDIF
    171175    ENDIF
    172     IF (ABS(lon_startphy(i)-longitude_deg(i))>=0.0001) THEN
    173       WRITE(*,*) "phyetat0: Warning! Longitude discrepancy wrt startphy file:",&
    174                  " i=",i," lon_startphy(i)=",lon_startphy(i),&
    175                  " longitude_deg(i)=",longitude_deg(i)
     176    IF (ABS(lon_startphy(i)-longitude_deg(i))>=1) THEN
     177      IF (ABS(360-ABS(lon_startphy(i)-longitude_deg(i))) > 0.0001) THEN
     178        WRITE(*,*) "phyetat0: Warning! Longitude discrepancy wrt startphy file:",&
     179                   " i=",i," lon_startphy(i)=",lon_startphy(i),&
     180                   " longitude_deg(i)=",longitude_deg(i)
     181      ENDIF
    176182    ENDIF
    177183  ENDDO
     
    223229        zmasq(i) = fractint(i)
    224230     ENDIF
    225   END DO
     231  ENDDO
    226232  fractint (1 : klon) =  pctsrf(1 : klon, is_oce)  &
    227233       + pctsrf(1 : klon, is_sic)
     
    234240        zmasq(i) = 1. - fractint(i)
    235241     ENDIF
    236   END DO
     242  ENDDO
    237243
    238244!===================================================================
     
    359365  !          dummy values (as is the case when generated by ce0l,
    360366  !          or by iniaqua)
    361   if ( (maxval(q_ancien).eq.minval(q_ancien))       .or. &
    362        (maxval(ql_ancien).eq.minval(ql_ancien))     .or. &
    363        (maxval(qs_ancien).eq.minval(qs_ancien))     .or. &
    364        (maxval(prw_ancien).eq.minval(prw_ancien))   .or. &
    365        (maxval(prlw_ancien).eq.minval(prlw_ancien)) .or. &
    366        (maxval(prsw_ancien).eq.minval(prsw_ancien)) .or. &
    367        (maxval(t_ancien).eq.minval(t_ancien)) ) then
     367  IF ( (maxval(q_ancien).EQ.minval(q_ancien))       .OR. &
     368       (maxval(ql_ancien).EQ.minval(ql_ancien))     .OR. &
     369       (maxval(qs_ancien).EQ.minval(qs_ancien))     .OR. &
     370       (maxval(prw_ancien).EQ.minval(prw_ancien))   .OR. &
     371       (maxval(prlw_ancien).EQ.minval(prlw_ancien)) .OR. &
     372       (maxval(prsw_ancien).EQ.minval(prsw_ancien)) .OR. &
     373       (maxval(t_ancien).EQ.minval(t_ancien)) ) THEN
    368374    ancien_ok=.false.
    369   endif
     375  ENDIF
    370376
    371377  found=phyetat0_get(klev,clwcon,"CLWCON","CLWCON",0.)
     
    434440        found=phyetat0_get(1,trs(:,it),"trs_"//tname(iiq), &
    435441              "Surf trac"//tname(iiq),0.)
    436      END DO
     442     ENDDO
    437443     CALL traclmdz_from_restart(trs)
    438444  ENDIF
     
    444450        IF (ierr /= 0) CALL abort_physic('phyetat0', 'pb allocation co2_send', 1)
    445451        found=phyetat0_get(1,co2_send,"co2_send","co2 send",co2_ppm)
    446      END IF
    447   END IF
     452     ENDIF
     453  ENDIF
    448454
    449455!===========================================
     
    452458
    453459!  ondes de gravite non orographiques
    454   if (ok_gwd_rando) found = &
     460  IF (ok_gwd_rando) found = &
    455461       phyetat0_get(klev,du_gwd_rando,"du_gwd_rando","du_gwd_rando",0.)
    456   IF (.not. ok_hines .and. ok_gwd_rando) found &
     462  IF (.NOT. ok_hines .AND. ok_gwd_rando) found &
    457463       = phyetat0_get(klev,du_gwd_front,"du_gwd_front","du_gwd_front",0.)
    458464
     
    473479
    474480  IF ( type_ocean == 'slab' ) THEN
    475       CALL ocean_slab_init(dtime, pctsrf)
     481      CALL ocean_slab_init(phys_tstep, pctsrf)
    476482      IF (nslay.EQ.1) THEN
    477483        found=phyetat0_get(1,tslab,"tslab01","tslab",0.)
    478484        IF (.NOT. found) THEN
    479485            found=phyetat0_get(1,tslab,"tslab","tslab",0.)
    480         END IF
     486        ENDIF
    481487      ELSE
    482488          DO i=1,nslay
    483489            WRITE(str2,'(i2.2)') i
    484490            found=phyetat0_get(1,tslab(:,i),"tslab"//str2,"tslab",0.) 
    485           END DO
    486       END IF
     491          ENDDO
     492      ENDIF
    487493      IF (.NOT. found) THEN
    488494          PRINT*, "phyetat0: Le champ <tslab> est absent"
     
    490496          DO i=1,nslay
    491497              tslab(:,i)=MAX(ftsol(:,is_oce),271.35)
    492           END DO
    493       END IF
     498          ENDDO
     499      ENDIF
    494500
    495501      ! Sea ice variables
     
    500506              PRINT*, "Initialisation a tsol_sic"
    501507                  tice(:)=ftsol(:,is_sic)
    502           END IF
     508          ENDIF
    503509          found=phyetat0_get(1,seaice,"seaice","seaice",0.)
    504510          IF (.NOT. found) THEN
     
    508514              WHERE (pctsrf(:,is_sic).GT.EPSFRA)
    509515                  seaice=917.
    510               END WHERE
    511           END IF
    512       END IF !sea ice INT
    513   END IF ! Slab       
     516              ENDWHERE
     517          ENDIF
     518      ENDIF !sea ice INT
     519  ENDIF ! Slab       
    514520
    515521  ! on ferme le fichier
     
    522528  ! Initialize module ocean_cpl_mod for the case of coupled ocean
    523529  IF ( type_ocean == 'couple' ) THEN
    524      CALL ocean_cpl_init(dtime, longitude_deg, latitude_deg)
    525   ENDIF
    526 
    527   CALL init_iophy_new(latitude_deg, longitude_deg)
     530     CALL ocean_cpl_init(phys_tstep, longitude_deg, latitude_deg)
     531  ENDIF
     532
     533!  CALL init_iophy_new(latitude_deg, longitude_deg)
    528534
    529535  ! Initilialize module fonte_neige_mod     
Note: See TracChangeset for help on using the changeset viewer.