Changeset 4056 for LMDZ6/trunk/libf/phylmdiso/physiq_mod.F90
- Timestamp:
- Jan 12, 2022, 10:54:09 PM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ6/trunk/libf/phylmdiso/physiq_mod.F90
r4050 r4056 39 39 USE ioipsl_getin_p_mod, ONLY : getin_p 40 40 USE indice_sol_mod 41 USE infotrac_phy, ONLY: nqtot, nbtr, nqo, t ype_trac,ok_isotopes, &42 nqtottr,itr_indice ! C Risi43 41 USE infotrac_phy, ONLY: nqtot, nbtr, nqo, tracers, type_trac, nqCO2, ok_isotopes 42 USE readTracFiles_mod, ONLY: phases_sep 43 USE strings_mod, ONLY: strIdx 44 44 USE iophy 45 45 USE limit_read_mod, ONLY : init_limit_read … … 61 61 USE phys_output_mod 62 62 USE phys_output_ctrlout_mod 63 USE print_control_mod, ONLY: mydebug=>debug , lunout, prt_level 63 USE print_control_mod, ONLY: mydebug=>debug , lunout, prt_level, & 64 alert_first_call, call_alert, prt_alerte 64 65 USE readaerosol_mod, ONLY : init_aero_fromfile 65 66 USE readaerosolstrato_m, ONLY : init_readaerosolstrato … … 123 124 #ifdef ISO 124 125 USE infotrac_phy, ONLY: & 125 iqiso,iso_indnum,tracers,ok_isotrac, & 126 niso,ntraciso,nqtottr,itr_indice ! ajout C Risi pour isos 126 iqiso,iso_indnum,ok_isotrac,niso, ntraciso 127 127 USE isotopes_mod, ONLY: iso_eau,iso_HDO,iso_O18,iso_O17,iso_HTO, & 128 128 & bidouille_anti_divergence,ok_bidouille_wake, & … … 188 188 ! 189 189 d_t_vdf,d_q_vdf,d_u_vdf,d_v_vdf,d_t_diss, & 190 d_t_vdf_ w,d_q_vdf_w, &191 d_ t_vdf_x,d_q_vdf_x, &190 d_t_vdf_x, d_t_vdf_w, & 191 d_q_vdf_x, d_q_vdf_w, & 192 192 d_ts, & 193 193 ! … … 262 262 zxfluxlat_x, zxfluxlat_w, & 263 263 ! 264 d_t_vdf_x, d_t_vdf_w, &265 d_q_vdf_x, d_q_vdf_w, &266 264 pbl_tke_input, tke_dissip, l_mix, wprime,& 267 265 t_therm, q_therm, u_therm, v_therm, & … … 939 937 real zqsat(klon,klev) 940 938 ! 941 INTEGER i, k, iq, j, nsrf, ll, l 942 INTEGER itr ! C Risi 939 INTEGER i, k, iq, j, nsrf, ll, l, itr 943 940 #ifdef ISO 944 941 real zxt_apres(ntraciso,klon) … … 1133 1130 !JLD REAL zstophy, zout 1134 1131 1135 CHARACTER *20 modname1132 CHARACTER (LEN=20) :: modname='physiq_mod' 1136 1133 CHARACTER*80 abort_message 1137 1134 LOGICAL, SAVE :: ok_sync, ok_sync_omp … … 1306 1303 pi = 4. * ATAN(1.) 1307 1304 1305 ! set-up call to alerte function 1306 call_alert = (alert_first_call .AND. is_master) 1307 1308 1308 ! Ehouarn: set value of jjmp1 since it is no longer a "fixed parameter" 1309 1309 jjmp1=nbp_lat … … 1424 1424 forall (k=1: nbp_lev) zmasse(:, k) = (paprs(:, k)-paprs(:, k+1)) / rg 1425 1425 1426 modname = 'physiq'1427 1426 1428 1427 IF (debut) THEN … … 1853 1852 1854 1853 CALL iniradia(klon,klev,paprs(1,1:klev+1)) 1855 1856 ! Initialisation des champs dans phytrac* qui sont utilisés par phys_output_write* 1854 ! 1855 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 1856 ! Initialisation des champs dans phytrac* qui sont utilises par phys_output_write* 1857 ! 1858 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 1859 1857 1860 #ifdef CPP_Dust 1858 1861 ! Quand on utilise SPLA, on force iflag_phytrac=1 … … 1899 1902 ENDDO 1900 1903 ENDDO 1901 1904 ELSE 1902 1905 pbl_tke(:,:,is_ave) = 0. !ym missing init : maybe must be initialized in the same way that for klon_glo==1 ?? 1903 1906 !>jyg … … 1949 1952 CALL abort_physic(modname,abort_message,1) 1950 1953 ENDIF 1954 1955 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 1956 ! Initialisation pour la convection de K.E. et pour les poches froides 1957 ! 1958 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 1959 1951 1960 WRITE(lunout,*)"Clef pour la convection, iflag_con=", iflag_con 1952 WRITE(lunout,*)"Clef pour le driver de la convection, ok_cvl=", & 1953 ok_cvl 1961 WRITE(lunout,*)"Clef pour le driver de la convection, ok_cvl=", ok_cvl 1954 1962 ! 1955 1963 !KE43 … … 2004 2012 d_deltaxt_ajs_cv(:,:,:) = 0. 2005 2013 #endif 2006 ENDIF 2014 ENDIF ! (iflag_wake>=1) 2007 2015 2008 2016 ! do i = 1,klon … … 2015 2023 ! ALLOCATE(lonGCM(0), latGCM(0)) 2016 2024 ! ALLOCATE(iGCM(0), jGCM(0)) 2017 ENDIF 2018 2025 ENDIF ! (iflag_con.GE.3) 2026 ! 2019 2027 DO i=1,klon 2020 2028 rugoro(i) = f_rugoro * MAX(1.0e-05, zstd(i)*zsig(i)/2.0) … … 2085 2093 !$OMP BARRIER 2086 2094 missing_val=missing_val_omp 2095 ! 2096 ! Now we activate some double radiation call flags only if some 2097 ! diagnostics are requested, otherwise there is no point in doing this 2098 IF (is_master) THEN 2099 !--setting up swaero_diag to TRUE in XIOS case 2100 IF (xios_field_is_active("topswad").OR.xios_field_is_active("topswad0").OR. & 2101 xios_field_is_active("solswad").OR.xios_field_is_active("solswad0").OR. & 2102 xios_field_is_active("topswai").OR.xios_field_is_active("solswai").OR. & 2103 (iflag_rrtm==1.AND.(xios_field_is_active("toplwad").OR.xios_field_is_active("toplwad0").OR. & 2104 xios_field_is_active("sollwad").OR.xios_field_is_active("sollwad0")))) & 2105 !!!--for now these fields are not in the XML files so they are omitted 2106 !!! xios_field_is_active("toplwai").OR.xios_field_is_active("sollwai") !))) & 2107 swaero_diag=.TRUE. 2108 2109 !--setting up swaerofree_diag to TRUE in XIOS case 2110 IF (xios_field_is_active("SWdnSFCcleanclr").OR.xios_field_is_active("SWupSFCcleanclr").OR. & 2111 xios_field_is_active("SWupTOAcleanclr").OR.xios_field_is_active("rsucsaf").OR. & 2112 xios_field_is_active("rsdcsaf") .OR. xios_field_is_active("LWdnSFCcleanclr").OR. & 2113 xios_field_is_active("LWupTOAcleanclr")) & 2114 swaerofree_diag=.TRUE. 2115 2116 !--setting up dryaod_diag to TRUE in XIOS case 2117 DO naero = 1, naero_tot-1 2118 IF (xios_field_is_active("dryod550_"//name_aero_tau(naero))) dryaod_diag=.TRUE. 2119 ENDDO 2120 ! 2121 !--setting up ok_4xCO2atm to TRUE in XIOS case 2122 IF (xios_field_is_active("rsut4co2").OR.xios_field_is_active("rlut4co2").OR. & 2123 xios_field_is_active("rsutcs4co2").OR.xios_field_is_active("rlutcs4co2").OR. & 2124 xios_field_is_active("rsu4co2").OR.xios_field_is_active("rsucs4co2").OR. & 2125 xios_field_is_active("rsd4co2").OR.xios_field_is_active("rsdcs4co2").OR. & 2126 xios_field_is_active("rlu4co2").OR.xios_field_is_active("rlucs4co2").OR. & 2127 xios_field_is_active("rld4co2").OR.xios_field_is_active("rldcs4co2")) & 2128 ok_4xCO2atm=.TRUE. 2129 ENDIF 2130 !$OMP BARRIER 2131 CALL bcast(swaero_diag) 2132 CALL bcast(swaerofree_diag) 2133 CALL bcast(dryaod_diag) 2134 CALL bcast(ok_4xCO2atm) 2087 2135 #endif 2088 2089 2136 ! 2090 2137 CALL printflag( tabcntr0,radpas,ok_journe, & 2091 2138 ok_instan, ok_region ) 2092 2139 ! 2093 2140 ! 2094 !2095 2141 ! Prescrire l'ozone dans l'atmosphere 2096 !2097 2142 ! 2098 2143 !c DO i = 1, klon … … 2150 2195 #endif 2151 2196 ENDIF 2197 ! 2152 2198 IF (type_trac == 'repr') THEN 2153 2199 #ifdef REPROBUS … … 2198 2244 SFRWL(6)=3.02191470E-02 2199 2245 END SELECT 2200 2201 2202 2246 !albedo SB <<< 2203 2247 … … 2331 2375 ! RomP <<< 2332 2376 ENDIF 2333 2334 2377 ! 2335 2378 ! Ne pas affecter les valeurs entrees de u, v, h, et q … … 2408 2451 2409 2452 tke0(:,:)=pbl_tke(:,:,is_ave) 2410 !C Risi:Nombre de traceurs de l'eau: nqo 2411 ! IF (nqtot.GE.3) THEN 2412 IF (nqtot.GE.(nqo+1)) THEN 2413 ! DO iq = 3, nqtot 2414 ! DO iq = nqo+1, nqtot 2415 ! CR: on modifie directement le code ici. 2416 ! les isotopes ne sont pas dispatchés dans tr_seri, il faut les enlever. 2417 ! on a prévu pour ça un tableau d'indice dans infotrac 2418 #ifdef ISOVERIF 2419 write(*,*) 'physiq 1971: nqtottr=',nqtottr 2420 #endif 2421 do itr=1,nqtottr 2422 iq=itr_indice(itr) 2453 IF (nqtot > nqo) THEN 2454 ! water isotopes are not included in tr_seri 2455 itr = 0 2456 DO iq = 1, nqtot 2457 IF(tracers(iq)%isH2Ofamily) CYCLE 2458 itr = itr+1 2423 2459 !#ifdef ISOVERIF 2424 2460 ! write(*,*) 'physiq 1973: itr,iq=',itr,iq … … 2427 2463 DO k = 1, klev 2428 2464 DO i = 1, klon 2429 tr_seri(i,k,itr) = qx(i,k,iq) ! modif C Risi2465 tr_seri(i,k,itr) = qx(i,k,iq) 2430 2466 ENDDO 2431 ENDDO !DO k = 1, klev2432 !write(*,*) 'physiq 1980'2433 enddo !do itr=1,nqtottr2434 2435 ELSE !IF (nqtot.GE.(nqo+1)) THEN2436 DO k = 1, klev2437 DO i = 1, klon2438 tr_seri(i,k,1) = 0.02439 2467 ENDDO 2440 2468 ENDDO 2441 ENDIF !IF (nqtot.GE.(nqo+1)) THEN 2469 ELSE 2470 ! DC: make sure the final "1" index was meant for 1st H2O phase (vapor) !!! 2471 ! tr_seri(:,:,strIdx(tracers(:)%name,'H2O'//phases_sep//'g')) = 0.0 2472 tr_seri(:,:,strIdx(tracers(:)%name,'H2Ov')) = 0.0 2473 ENDIF 2442 2474 ! 2443 2475 ! Temporary solutions adressing ticket #104 and the non initialisation of tr_ancien … … 2445 2477 IF (debut) THEN 2446 2478 WRITE(lunout,*)' WARNING: tr_ancien initialised to tr_seri' 2447 ! DO iq = nqo+1, nqtot 2448 ! tr_ancien(:,:,iq-nqo)=tr_seri(:,:,iq-nqo) 2449 ! ENDDO 2450 ! modif CRisi: 2451 do itr=1,nqtottr 2479 itr = 0 2480 do iq = 1, nqtot 2481 IF(tracers(iq)%isH2Ofamily) CYCLE 2482 itr = itr+1 2452 2483 tr_ancien(:,:,itr)=tr_seri(:,:,itr) 2453 2484 enddo … … 2519 2550 d_qs_dyn2d(:)=(zx_tmp_fi2d(:)-prsw_ancien(:))/phys_tstep 2520 2551 ! !! RomP >>> td dyn traceur 2521 IF (nqtot.GT.nqo) THEN ! jyg 2522 ! DO iq = nqo+1, nqtot ! jyg 2523 DO itr=1,nqtottr ! C Risi modif directe 2524 d_tr_dyn(:,:,itr)=(tr_seri(:,:,itr)-tr_ancien(:,:,itr))/phys_tstep ! jyg 2525 ENDDO 2526 ENDIF 2552 IF (nqtot > nqo) d_tr_dyn(:,:,:)=(tr_seri(:,:,:)-tr_ancien(:,:,:))/phys_tstep 2527 2553 ! !! RomP <<< 2528 2554 … … 2627 2653 2628 2654 ! !! RomP >>> td dyn traceur 2629 IF (nqtot.GT.nqo) THEN ! jyg 2630 ! DO iq = nqo+1, nqtot ! jyg 2631 ! d_tr_dyn(:,:,iq-nqo)= 0.0 ! jyg 2632 ! Modif C Risi: 2633 DO itr=1,nqtottr 2634 d_tr_dyn(:,:,itr)= 0.0 2635 ENDDO 2636 ENDIF 2655 IF (nqtot > nqo) d_tr_dyn(:,:,:)= 0.0 2637 2656 ! !! RomP <<< 2638 2657 ancien_ok = .TRUE. … … 3363 3382 ENDDO 3364 3383 ENDDO 3365 ELSE !IF (iflag_wake>=1) THEN3384 ELSE 3366 3385 t_w(:,:) = t_seri(:,:) 3367 3386 q_w(:,:) = q_seri(:,:) … … 3752 3771 ! où i n'est pas un point convectif et donc ibas_con(i)=0 3753 3772 ! c'est un pb indépendant des isotopes 3754 if (ibas_con(i).gt.0) then 3755 ema_pcb(i) = paprs(i,ibas_con(i)) 3756 else ! if (ibas_con(i).gt.0) then 3757 ema_pcb(i) = 0.0 3758 endif ! if (ibas_con(i).gt.0) then 3759 3773 if (ibas_con(i) > 0) then 3774 ema_pcb(i) = paprs(i,ibas_con(i)) 3775 else 3776 ema_pcb(i) = 0.0 3777 endif 3760 3778 ENDDO 3761 3779 DO i = 1, klon … … 4484 4502 ENDDO 4485 4503 4486 CALL calcratqs(klon,klev,prt_level,lunout, &4504 CALL calcratqs(klon,klev,prt_level,lunout, & 4487 4505 iflag_ratqs,iflag_con,iflag_cld_th,pdtphys, & 4488 4506 ratqsbas,ratqshaut,ratqsp0, ratqsdp, & … … 4492 4510 pbl_tke(:,:,is_ave),tke_dissip_ave,l_mix_ave,wprime_ave,t2m,q2m,fm_therm, & 4493 4511 ratqs,ratqsc,ratqs_inter) 4494 4495 4512 4496 4513 ! … … 5608 5625 ZLWFT0_i, ZFLDN0, ZFLUP0, & 5609 5626 ZSWFT0_i, ZFSDN0, ZFSUP0) 5610 endif!ok_4xCO2atm5627 ENDIF !ok_4xCO2atm 5611 5628 ENDIF ! aerosol_couple 5612 5629 itaprad = 0 … … 6485 6502 #endif 6486 6503 ! #ifdef ISO 6487 ! 6488 !CR: nb de traceurs eau: nqo 6489 ! IF (nqtot.GE.3) THEN 6490 IF (nqtot.GE.(nqo+1)) THEN 6491 ! DO iq = 3, nqtot 6492 ! DO iq = nqo+1, nqtot ! modif C Risi 6493 do itr=1,nqtottr 6494 iq=itr_indice(itr) 6495 DO k = 1, klev 6496 DO i = 1, klon 6497 ! d_qx(i,k,iq) = ( tr_seri(i,k,iq-2) - qx(i,k,iq) ) / phys_tstep 6498 d_qx(i,k,iq) = ( tr_seri(i,k,iq-nqo) - qx(i,k,iq) ) / phys_tstep 6499 ENDDO 6504 ! DC: All iterations are cycled if nqtot==nqo, so no nqtot>nqo condition required 6505 itr = 0 6506 DO iq = 1, nqtot 6507 IF(tracers(iq)%isH2Ofamily) CYCLE 6508 itr = itr+1 6509 DO k = 1, klev 6510 DO i = 1, klon 6511 d_qx(i,k,iq) = ( tr_seri(i,k,itr) - qx(i,k,iq) ) / phys_tstep 6500 6512 ENDDO 6501 ENDDO ! !do itr=1,nqtottr6502 END IF6513 ENDDO 6514 ENDDO 6503 6515 ! 6504 6516 !IM rajout diagnostiques bilan KP pour analyse MJO par Jun-Ichi Yano … … 6558 6570 CALL water_int(klon,klev,qs_ancien,zmasse,prsw_ancien) 6559 6571 ! !! RomP >>> 6560 !CR: nb de traceurs eau: nqo 6561 IF (nqtot.GT.nqo) THEN 6562 ! DO iq = nqo+1, nqtot ! modif C Risi 6563 do itr=1,nqtottr 6564 tr_ancien(:,:,itr) = tr_seri(:,:,itr) 6565 ENDDO 6566 ENDIF 6572 IF (nqtot > nqo) tr_ancien(:,:,:) = tr_seri(:,:,:) 6567 6573 ! !! RomP <<< 6568 6574 !========================================================================== … … 6795 6801 ! ISO 6796 6802 6803 ! Disabling calls to the prt_alerte function 6804 alert_first_call = .FALSE. 6805 6797 6806 IF (lafin) THEN 6798 6807 itau_phy = itau_phy + itap
Note: See TracChangeset
for help on using the changeset viewer.