Ignore:
Timestamp:
Dec 6, 2022, 12:01:16 AM (18 months ago)
Author:
lguez
Message:

Sync latest trunk changes to Ocean_skin

Location:
LMDZ6/branches/Ocean_skin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • LMDZ6/branches/Ocean_skin

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

    r4023 r4368  
    1919                                zval, rugoro, t_ancien, q_ancien,            &
    2020                                prw_ancien, prlw_ancien, prsw_ancien,        &
    21                                 ql_ancien, qs_ancien,  u_ancien,            &
     21                                ql_ancien, qs_ancien, rneb_ancien, u_ancien, &
    2222                                v_ancien, clwcon, rnebcon, ratqs, pbl_tke,   &
    2323                                wake_delta_pbl_tke, zmax0, f0, sig1, w01,    &
     
    3535  USE iostart, ONLY: open_restartphy, close_restartphy, enddef_restartphy, put_field, put_var
    3636  USE traclmdz_mod, ONLY : traclmdz_to_restart
    37   USE infotrac_phy, ONLY: type_trac, niadv, tname, nbtr, nqo
    38   USE carbon_cycle_mod, ONLY : carbon_cycle_cpl, co2_send
     37  USE infotrac_phy, ONLY: type_trac, types_trac, nqtot, tracers, nbtr
     38  USE carbon_cycle_mod, ONLY : carbon_cycle_cpl, co2_send, carbon_cycle_rad, RCO2_glo
    3939  USE indice_sol_mod, ONLY: nbsrf, is_oce, is_sic, is_ter, is_lic, epsfra
    4040  USE surface_data, ONLY: type_ocean, version_ocean
     
    4747  include "dimsoil.h"
    4848  include "clesphys.h"
    49   include "thermcell.h"
     49  include "alpale.h"
    5050  include "compbl.h"
    5151  !======================================================================
     
    7070  CHARACTER (len=2) :: str2
    7171  CHARACTER (len=256) :: nam, lnam
    72   INTEGER           :: it, iiq, pass
     72  INTEGER           :: it, iq, pass
    7373
    7474  !======================================================================
     
    108108
    109109  ! co2_ppm0 : initial value of atmospheric CO2
    110   tab_cntrl(16) = co2_ppm0
     110  ! tab_cntrl(16) = co2_ppm0
     111
     112  !  PC -- initial value of RCO2 for the radiation scheme
     113  !  tab_cntrl(17) = co2_ppm * 1.0e-06 * RMCO2 / RMD
     114  IF (carbon_cycle_rad) tab_cntrl(17) = RCO2_glo
     115  !PRINT*, "PC : phyredem RCO2_glo =",RCO2_glo
    111116
    112117  DO pass=1,2   ! pass=1 netcdf definition ; pass=2 netcdf write
     
    140145
    141146    CALL put_field(pass,"FLIC", "fraction glace de terre", pctsrf(:, is_lic))
    142 
    143147    ! 3. fraction ocean
    144148
     
    240244    CALL put_field(pass,"QSANCIEN", "QSANCIEN", qs_ancien)
    241245
     246    CALL put_field(pass,"RNEBANCIEN", "RNEBANCIEN", rneb_ancien)
     247
    242248    CALL put_field(pass,"PRWANCIEN", "PRWANCIEN", prw_ancien)
    243249
     
    323329
    324330
    325     ! trs from traclmdz_mod
    326     IF (type_trac == 'lmdz') THEN
    327        CALL traclmdz_to_restart(trs)
    328        DO it=1, nbtr
    329 !!        iiq=niadv(it+2)                                                           ! jyg
    330           iiq=niadv(it+nqo)                                                           ! jyg
    331           CALL put_field(pass,"trs_"//tname(iiq), "", trs(:, it))
    332        END DO
    333     END IF
    334 
    335     IF (type_trac == 'co2i' .OR. type_trac == 'inco') THEN
     331    IF (ANY(types_trac == 'co2i') .OR. ANY(types_trac == 'inco')) THEN
    336332       IF (carbon_cycle_cpl) THEN
    337333          IF (.NOT. ALLOCATED(co2_send)) THEN
     
    342338          CALL put_field(pass,"co2_send", "co2_ppm for coupling", co2_send)
    343339       END IF
     340
     341    ! trs from traclmdz_mod
     342    ELSE IF (type_trac == 'lmdz') THEN
     343       CALL traclmdz_to_restart(trs)
     344       it = 0
     345       DO iq = 1, nqtot
     346          IF(.NOT.(tracers(iq)%isAdvected .AND. tracers(iq)%isInPhysics)) CYCLE
     347          it = it+1
     348          CALL put_field(pass,"trs_"//tracers(iq)%name, "", trs(:, it))
     349       END DO
    344350    END IF
    345351
     
    387393    IF (pass==1) CALL enddef_restartphy
    388394    IF (pass==2) CALL close_restartphy
    389  ENDDO
     395  ENDDO ! DO pass=1,2   ! pass=1 netcdf definition ; pass=2 netcdf write
    390396 
    391397  !$OMP BARRIER
     
    398404
    399405  IMPLICIT NONE
    400   INTEGER, INTENT(IN)            :: pass
     406  INTEGER, INTENT(IN)           :: pass
    401407  CHARACTER(LEN=*),  INTENT(IN) :: nam, lnam
    402408  REAL,              INTENT(IN) :: field(:,:)
Note: See TracChangeset for help on using the changeset viewer.