Changeset 2980 for trunk/LMDZ.COMMON/libf/evolution
- Timestamp:
- Jun 12, 2023, 4:38:28 PM (19 months ago)
- Location:
- trunk/LMDZ.COMMON/libf/evolution
- Files:
-
- 3 added
- 5 deleted
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.COMMON/libf/evolution/abort_pem.F
r2888 r2980 1 1 ! 2 ! $Id: abort_pem.F 1425 2010-09-02 13:45:23Z lguez $2 ! $Id: abort_pem.F 3 3 ! 4 4 c … … 44 44 #endif 45 45 call getin_dump 46 c call histclo(2)47 c call histclo(3)48 c call histclo(4)49 c call histclo(5)50 46 write(lunout,*) 'Stopping in ', modname 51 47 write(lunout,*) 'Reason = ',message -
trunk/LMDZ.COMMON/libf/evolution/adsorption_mod.F90
r2944 r2980 13 13 !!! 14 14 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 15 16 17 15 subroutine ini_adsorption_h_PEM(ngrid,nslope,nsoilmx_PEM) 18 16 … … 25 23 end subroutine ini_adsorption_h_PEM 26 24 25 !!! ----------------------------------------------- 26 27 27 subroutine end_adsorption_h_PEM 28 28 … … 32 32 end subroutine end_adsorption_h_PEM 33 33 34 35 36 37 34 !!! ----------------------------------------------- 38 35 39 36 subroutine regolith_adsorption(ngrid,nslope,nsoil_PEM,timelen,tend_h2oglaciers,tend_co2glaciers,waterice,co2ice,tsoil_PEM,TI_PEM,ps,q_co2,q_h2o, & … … 354 351 theta_h2o_adsorbed, m_h2o_adsorbed,delta_mh2o) 355 352 356 357 358 353 ! 2. we compute the mass of co2 adsorded in each layer of the meshes 359 354 -
trunk/LMDZ.COMMON/libf/evolution/comsoil_h_PEM.F90
r2945 r2980 2 2 3 3 implicit none 4 integer, parameter :: nsoilmx_PEM = 27 ! number of layers in the PEM5 real,save,allocatable,dimension(:) :: layer_PEM ! soil layer depths [m]6 real,save,allocatable,dimension(:) :: mlayer_PEM ! soil mid-layer depths [m]7 real,save,allocatable,dimension(:,:,:) :: TI_PEM ! soil thermal inertia [SI]4 integer, parameter :: nsoilmx_PEM = 27 ! number of layers in the PEM 5 real,save,allocatable,dimension(:) :: layer_PEM ! soil layer depths [m] 6 real,save,allocatable,dimension(:) :: mlayer_PEM ! soil mid-layer depths [m] 7 real,save,allocatable,dimension(:,:,:) :: TI_PEM ! soil thermal inertia [SI] 8 8 real,save,allocatable,dimension(:,:) :: inertiedat_PEM ! soil thermal inertia saved as reference for current climate [SI] 9 9 ! variables (FC: built in firstcall in soil.F) 10 REAL,SAVE,ALLOCATABLE :: tsoil_PEM(:,:,:) ! sub-surface temperatures [K]11 real,save,allocatable :: mthermdiff_PEM(:,:) ! (FC) mid-layer thermal diffusivity [SI]12 real,save,allocatable :: thermdiff_PEM(:,:) ! (FC) inter-layer thermal diffusivity [SI]13 real,save,allocatable :: coefq_PEM(:) ! (FC) q_{k+1/2} coefficients [SI]14 real,save,allocatable :: coefd_PEM(:,:) ! (FC) d_k coefficients [SI]15 real,save,allocatable :: alph_PEM(:,:) ! (FC) alpha_k coefficients [SI]16 real,save,allocatable :: beta_PEM(:,:) ! beta_k coefficients [SI]17 real,save :: mu_PEM ! mu coefficient [SI]18 real,save :: fluxgeo ! Geothermal flux [W/m^2]19 real,save :: depth_breccia ! Depth at which we have breccia [m]20 real,save :: depth_bedrock ! Depth at which we have bedrock [m]21 integer,save :: index_breccia ! last index of the depth grid before having breccia22 integer,save :: index_bedrock ! last index of the depth grid before having bedrock10 REAL,SAVE,ALLOCATABLE :: tsoil_PEM(:,:,:) ! sub-surface temperatures [K] 11 real,save,allocatable :: mthermdiff_PEM(:,:) ! (FC) mid-layer thermal diffusivity [SI] 12 real,save,allocatable :: thermdiff_PEM(:,:) ! (FC) inter-layer thermal diffusivity [SI] 13 real,save,allocatable :: coefq_PEM(:) ! (FC) q_{k+1/2} coefficients [SI] 14 real,save,allocatable :: coefd_PEM(:,:) ! (FC) d_k coefficients [SI] 15 real,save,allocatable :: alph_PEM(:,:) ! (FC) alpha_k coefficients [SI] 16 real,save,allocatable :: beta_PEM(:,:) ! beta_k coefficients [SI] 17 real,save :: mu_PEM ! mu coefficient [SI] 18 real,save :: fluxgeo ! Geothermal flux [W/m^2] 19 real,save :: depth_breccia ! Depth at which we have breccia [m] 20 real,save :: depth_bedrock ! Depth at which we have bedrock [m] 21 integer,save :: index_breccia ! last index of the depth grid before having breccia 22 integer,save :: index_bedrock ! last index of the depth grid before having bedrock 23 23 LOGICAL soil_pem ! True by default, to run with the subsurface physic. Read in pem.def 24 real,save,allocatable,dimension(:) :: water_reservoir 25 real,save :: water_reservoir_nom 26 logical, save :: reg_thprop_dependp ! thermal properites of the regolith vary with the surface pressure24 real,save,allocatable,dimension(:) :: water_reservoir ! Large reserve of water [kg/m^2] 25 real,save :: water_reservoir_nom ! Nominal value for the large reserve of water [kg/m^2] 26 logical, save :: reg_thprop_dependp ! thermal properites of the regolith vary with the surface pressure 27 27 28 28 contains -
trunk/LMDZ.COMMON/libf/evolution/conf_pem.F90
r2963 r2980 1 1 MODULE conf_pem_mod 2 3 !======================================================================= 4 ! 5 ! Purpose: Read the parameter for a PEM run in run_pem.def 6 ! 7 ! Author: RV 8 !======================================================================= 2 9 3 10 IMPLICIT NONE -
trunk/LMDZ.COMMON/libf/evolution/criterion_pem_stop_mod.F90
r2893 r2980 30 30 31 31 ! INPUT 32 INTEGER, intent(in) :: ngrid ! # of grid physical grid points33 REAL, intent(in) :: cell_area(ngrid) ! physical point field : Area of the cells34 REAL, intent(in) :: qsurf(ngrid,nslope) ! physical point field : Actual density of water ice35 REAL, intent(in) :: ini_surf 36 REAL, intent(in) :: initial_h2o_ice(ngrid,nslope) 32 INTEGER, intent(in) :: ngrid ! # of grid physical grid points 33 REAL, intent(in) :: cell_area(ngrid) ! physical point field : Area of the cells 34 REAL, intent(in) :: qsurf(ngrid,nslope) ! physical point field : Actual density of water ice 35 REAL, intent(in) :: ini_surf ! Initial surface of h2o ice that was sublimating 36 REAL, intent(in) :: initial_h2o_ice(ngrid,nslope) ! Grid point that initialy were covered by h2o_ice 37 37 38 38 ! OUTPUT … … 41 41 ! local: 42 42 ! ----- 43 INTEGER :: i,islope 43 INTEGER :: i,islope ! Loop 44 44 REAL :: present_surf ! Initial/Actual surface of water ice 45 45 … … 77 77 ! ------------------------------------------------------------------------------------------------ 78 78 79 80 SUBROUTINE criterion_co2_stop(cell_area,ini_surf,qsurf,STOPPING_ice,STOPPING_ps,ngrid,initial_h2o_ice,global_ave_press_GCM,global_ave_press_new,nslope) 79 SUBROUTINE criterion_co2_stop(cell_area,ini_surf,qsurf,STOPPING_ice,STOPPING_ps,ngrid,initial_co2_ice,global_ave_press_GCM,global_ave_press_new,nslope) 81 80 82 81 USE temps_mod_evol, ONLY: co2_ice_criterion,ps_criterion … … 98 97 REAL, intent(in) :: cell_area(ngrid) ! physical point field : Area of the cells 99 98 REAL, intent(in) :: qsurf(ngrid,nslope) ! physical point field : Actual density of water ice 100 REAL, intent(in) :: ini_surf 101 REAL, intent(in) :: initial_ h2o_ice(ngrid,nslope)102 REAL, intent(in) :: global_ave_press_GCM 103 REAL, intent(in) :: global_ave_press_new 99 REAL, intent(in) :: ini_surf ! Initial surface of co2 ice that was sublimating 100 REAL, intent(in) :: initial_co2_ice(ngrid,nslope) ! Grid point that initialy were covered by co2_ice 101 REAL, intent(in) :: global_ave_press_GCM ! Planet average pressure from the GCM start files 102 REAL, intent(in) :: global_ave_press_new ! Planet average pressure from the PEM computations 104 103 105 104 ! OUTPUT … … 120 119 do i=1,ngrid 121 120 do islope=1,nslope 122 if (initial_ h2o_ice(i,islope).GT.0.5 .and. qsurf(i,islope).GT.0.) then121 if (initial_co2_ice(i,islope).GT.0.5 .and. qsurf(i,islope).GT.0.) then 123 122 present_surf=present_surf+cell_area(i)*subslope_dist(i,islope) 124 123 endif -
trunk/LMDZ.COMMON/libf/evolution/ice_table_mod.F90
r2961 r2980 37 37 end subroutine end_ice_table_porefilling 38 38 39 40 39 !!! -------------------------------------- 41 40 42 41 SUBROUTINE computeice_table_equilibrium(ngrid,nslope,nsoil_PEM,watercaptag,rhowatersurf_ave,rhowatersoil_ave,regolith_inertia,ice_table_beg,ice_table_thickness) … … 134 133 enddo 135 134 136 !=======================================================================137 135 RETURN 138 136 #endif 139 137 END 140 138 139 !!! -------------------------------------- 141 140 142 141 SUBROUTINE find_layering_icetable(porefill,psat_soil,psat_surf,pwat_surf,psat_bottom,B,index_IS,depth_filling,index_filling,index_geothermal,depth_geothermal,dz_etadz_rho) … … 189 188 real :: pvap2rho = 18.e-3/8.314 190 189 ! 191 192 193 194 195 190 196 191 ! 0. Compute constriction over the layer … … 300 295 end subroutine 301 296 302 303 297 !!! -------------------------------------- 304 298 305 299 SUBROUTINE constriction(porefill,eta) … … 318 312 !!! 319 313 320 321 314 if (porefill.le.0.) eta = 1. 322 315 if ((porefill.gt.0.) .and.(porefill.lt.1.)) then … … 327 320 end subroutine 328 321 329 330 322 end module -
trunk/LMDZ.COMMON/libf/evolution/info_run_PEM.F90
r2888 r2980 1 1 SUBROUTINE info_run_PEM(year_iter, criterion_stop) 2 3 !======================================================================= 4 ! 5 ! Purpose: Write in a file called info_run_PEM.txt the reason why the PEM did stop and the number of extrapolation year done 6 ! 7 ! Author: RV 8 !======================================================================= 2 9 3 10 IMPLICIT NONE 4 11 5 INTEGER, intent(in) :: year_iter, criterion_stop 12 INTEGER, intent(in) :: year_iter, criterion_stop ! # of year and reason to stop 6 13 7 14 logical :: exist 8 9 15 10 16 inquire(file='info_run_PEM.txt', exist=exist) -
trunk/LMDZ.COMMON/libf/evolution/lask_param_mod.F90
r2855 r2980 11 11 12 12 real,save,allocatable :: yearlask(:) ! year before present from Laskar et al. Tab 13 real,save,allocatable :: oblask(:) ! obliquity [deg]14 real,save,allocatable :: exlask(:) ! excentricity [deg]13 real,save,allocatable :: oblask(:) ! obliquity [deg] 14 real,save,allocatable :: exlask(:) ! excentricity [deg] 15 15 real,save,allocatable :: lsplask(:) ! ls perihelie [deg] 16 16 integer, save :: last_ilask ! Index of the line in the file year_obl_lask.asc corresponding to the closest lower year to the current year -
trunk/LMDZ.COMMON/libf/evolution/nb_time_step_GCM.F90
r2855 r2980 44 44 write(*,*)"read_data_GCM: Le champ <time_counter> est absent" 45 45 write(*,*)"read_data_GCM: J essaie <Time>" 46 ierr = nf90_inq_varid (fID, "Time", vID) 46 47 IF (ierr .NE. nf90_noerr) THEN 47 48 write(*,*)"read_data_GCM: Le champ <Time> est absent" 48 49 write(*,*)trim(nf90_strerror(ierr)) 49 CALL ABORT_gcm(" read_data_GCM", "", 1)50 CALL ABORT_gcm("nb_time_step_GCM", "", 1) 50 51 ENDIF 51 52 ! Get the length of the "Time" dimension 52 53 ierr = nf90_inq_dimid(fID,"Time",vID) 53 54 ierr = nf90_inquire_dimension(fID,vID,len=timelen) 54 E NDIF55 ELSE 55 56 ! Get the length of the "time_counter" dimension 56 57 ierr = nf90_inq_dimid(fID,"time_counter",vID) 57 58 ierr = nf90_inquire_dimension(fID,vID,len=timelen) 59 ENDIF 58 60 ELSE 59 61 ! Get the length of the "temps" dimension -
trunk/LMDZ.COMMON/libf/evolution/orbit_param_criterion_mod.F90
r2963 r2980 1 1 MODULE orbit_param_criterion_mod 2 3 !======================================================================= 4 ! 5 ! Purpose: Compute the maximum nimber of iteration the PEM can do based 6 ! on the stopping criterion given by the orbital parameters 7 ! 8 ! Author: RV 9 !======================================================================= 2 10 3 11 IMPLICIT NONE … … 34 42 35 43 real :: Year ! Year of the simulation 36 real :: timeperi_ls 37 integer nlask,ilask!,last_ilask !Loop variable38 parameter (nlask = 20001) 44 real :: timeperi_ls ! Year of the simulation 45 integer nlask,ilask!,last_ilask ! Loop variable 46 parameter (nlask = 20001) ! Number of line in Laskar file 39 47 40 48 real max_change_obl,max_change_ex,max_change_lsp ! Percentage of change that is considered to be acceptible 41 49 42 real max_obl,max_ex,max_lsp !Maximum value of orbit param given the acceptable percentage 43 real min_obl,min_ex,min_lsp !Maximum value of orbit param given the acceptable percentage 44 45 real max_obl_iter,max_ex_iter,max_lsp_iter !Maximum year iteration before reaching an unacceptable value 46 47 logical obl_not_found, ex_not_found,lsp_not_found !Loop variable (first call) 48 logical max_lsp_modulo,min_lsp_modulo 50 real max_obl,max_ex,max_lsp ! Maximum value of orbit param given the acceptable percentage 51 real min_obl,min_ex,min_lsp ! Maximum value of orbit param given the acceptable percentage 52 53 real max_obl_iter,max_ex_iter,max_lsp_iter ! Maximum year iteration before reaching an unacceptable value 54 55 logical obl_not_found, ex_not_found,lsp_not_found ! Loop variable (first call) 56 logical max_lsp_modulo,min_lsp_modulo ! Variable to check if we are close to the 360 degree modulo for lsp parameter 57 58 real xa,xb,ya,yb,yc 49 59 50 60 ! ********************************************************************** … … 52 62 ! ********************************************************************** 53 63 54 Year=year_bp_ini+year_PEM 55 timeperi_ls=timeperi*360/2/pi 56 57 call ini_lask_param_mod(nlask) 64 Year=year_bp_ini+year_PEM ! We compute the current year 65 timeperi_ls=timeperi*360/2/pi ! We convert in degree 66 67 call ini_lask_param_mod(nlask) ! Allocation of variables 58 68 59 69 print *, "orbit_param_criterion, Year in pem.def=", year_bp_ini … … 63 73 print *, "orbit_param_criterion, Current ex=", e_elips 64 74 print *, "orbit_param_criterion, Current lsp=", timeperi_ls 75 76 ! We read the file 65 77 66 78 open(73,file='ob_ex_lsp.asc') … … 139 151 max_lsp_iter=999999999999 140 152 153 !-------------------------------- 154 155 yc=max_obl 156 yc=min_obl 157 158 !-------------------------------- 159 141 160 do ilask=last_ilask,1,-1 142 if((oblask(ilask).GT.max_obl).and. obl_not_found ) then 143 max_obl_iter=(max_obl-oblask(ilask-1)) * (yearlask(ilask)-yearlask(ilask-1)) & 144 / (oblask(ilask)-oblask(ilask-1))+yearlask(ilask-1)-Year 161 162 xa=yearlask(ilask) 163 xb=yearlask(ilask-1) 164 ! Linear interpolation to find the maximum number of iteration 165 if((oblask(ilask-1).GT.max_obl).and. obl_not_found ) then 166 ya=oblask(ilask) 167 yb=oblask(ilask-1) 168 yc=max_obl 169 max_obl_iter=xa*(yc-yb)/(ya-yb)+xb*(ya-yc)/(ya-yb)-Year 145 170 obl_not_found=.FALSE. 146 elseif((oblask(ilask).LT.min_obl).and. obl_not_found ) then 147 max_obl_iter=(min_obl-oblask(ilask-1)) * (yearlask(ilask)-yearlask(ilask-1)) & 148 / (oblask(ilask)-oblask(ilask-1))+yearlask(ilask-1)-Year 171 elseif((oblask(ilask-1).LT.min_obl).and. obl_not_found ) then 172 ya=oblask(ilask) 173 yb=oblask(ilask-1) 174 yc=min_obl 175 max_obl_iter=xa*(yc-yb)/(ya-yb)+xb*(ya-yc)/(ya-yb)-Year 149 176 obl_not_found=.FALSE. 150 177 endif 151 if((exlask(ilask).GT.max_ex).and. ex_not_found ) then 152 max_ex_iter=(max_ex-exlask(ilask-1)) * (yearlask(ilask)-yearlask(ilask-1)) & 153 / (exlask(ilask)-exlask(ilask-1))+yearlask(ilask-1)-Year 178 if((exlask(ilask-1).GT.max_ex).and. ex_not_found ) then 179 ya=exlask(ilask) 180 yb=exlask(ilask-1) 181 yc=max_ex 182 max_ex_iter=xa*(yc-yb)/(ya-yb)+xb*(ya-yc)/(ya-yb)-Year 154 183 ex_not_found=.FALSE. 155 elseif((exlask(ilask).LT.min_ex ).and. ex_not_found ) then 156 max_ex_iter=(min_ex-exlask(ilask-1)) * (yearlask(ilask)-yearlask(ilask-1)) & 157 / (exlask(ilask)-exlask(ilask-1))+yearlask(ilask-1)-Year 184 elseif((exlask(ilask-1).LT.min_ex ).and. ex_not_found ) then 185 ya=exlask(ilask) 186 yb=exlask(ilask-1) 187 yc=min_ex 188 max_ex_iter=xa*(yc-yb)/(ya-yb)+xb*(ya-yc)/(ya-yb)-Year 158 189 ex_not_found=.FALSE. 159 190 endif 160 191 if(max_lsp_modulo .and. lsplask(ilask).lt.180) lsplask(ilask)=lsplask(ilask)+360. 161 192 if(min_lsp_modulo .and. lsplask(ilask).gt.180) lsplask(ilask)=lsplask(ilask)-360. 162 if((lsplask(ilask).GT.max_lsp).and. lsp_not_found ) then 163 max_lsp_iter=(max_lsp-lsplask(ilask-1)) * (yearlask(ilask)-yearlask(ilask-1)) & 164 / (lsplask(ilask)-lsplask(ilask-1))+yearlask(ilask-1)-Year 193 if((lsplask(ilask-1).GT.max_lsp).and. lsp_not_found ) then 194 ya=lsplask(ilask) 195 yb=lsplask(ilask-1) 196 yc=max_lsp 197 max_ex_iter=xa*(yc-yb)/(ya-yb)+xb*(ya-yc)/(ya-yb)-Year 165 198 lsp_not_found=.FALSE. 166 elseif((lsplask(ilask).LT.min_lsp ).and. lsp_not_found ) then 167 max_lsp_iter=(min_lsp-lsplask(ilask-1)) * (yearlask(ilask)-yearlask(ilask-1)) & 168 / (lsplask(ilask)-lsplask(ilask-1))+yearlask(ilask-1)-Year 199 elseif((lsplask(ilask-1).LT.min_lsp ).and. lsp_not_found ) then 200 ya=lsplask(ilask) 201 yb=lsplask(ilask-1) 202 yc=min_lsp 203 max_ex_iter=xa*(yc-yb)/(ya-yb)+xb*(ya-yc)/(ya-yb)-Year 169 204 lsp_not_found=.FALSE. 170 205 endif -
trunk/LMDZ.COMMON/libf/evolution/pem.F90
r2963 r2980 54 54 nf90_get_var, nf90_inq_varid, nf90_inq_dimid, & 55 55 nf90_inquire_dimension,nf90_close 56 56 #ifndef CPP_1D 57 USE iniphysiq_mod, ONLY: iniphysiq 57 58 ! For phyredem : 58 59 USE control_mod, ONLY: iphysiq, day_step,nsplit_phys 59 USE iniphysiq_mod, ONLY: iniphysiq 60 #else 61 use time_phylmdz_mod, only: daysec, iphysiq,day_step 62 #endif 60 63 USE logic_mod, ONLY: iflag_phys 61 64 #ifndef CPP_STD … … 85 88 use constants_marspem_mod,only: alpha_clap_co2,beta_clap_co2, alpha_clap_h2o,beta_clap_h2o, & 86 89 m_co2,m_noco2 90 use evol_co2_ice_s_mod, only: evol_co2_ice_s 91 use evol_h2o_ice_s_mod, only: evol_h2o_ice_s 87 92 88 93 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!! SOIL … … 105 110 use soil_thermalproperties_mod, only: update_soil_thermalproperties 106 111 112 #ifdef CPP_1D 113 use regular_lonlat_mod, only: init_regular_lonlat 114 use physics_distribution_mod, only: init_physics_distribution 115 use mod_grid_phy_lmdz, only : regular_lonlat 116 use init_phys_1d_mod, only : init_phys_1d 117 #endif 118 107 119 108 120 IMPLICIT NONE … … 114 126 PARAMETER( ngridmx = 2+(jjm-1)*iim - 1/jjm ) 115 127 116 include "comdissnew.h"117 128 include "comgeom.h" 118 129 include "iniprint.h" … … 177 188 LOGICAL :: STOPPING_1_water ! Logical : is there still water ice to sublimate? 178 189 LOGICAL :: STOPPING_co2 ! Logical : is the criterion (% of change in the surface of sublimating water ice) reached? 179 LOGICAL :: STOPPING_1_co2 ! Logical : is there still water ice to sublimate?180 190 LOGICAL :: STOPPING_pressure 181 191 INTEGER :: criterion_stop ! which criterion is reached ? 1= h2o ice surf, 2 = co2 ice surf, 3 = ps, 4 = orb param 182 192 183 real,save :: A , B, mmean ! Molar mass: intermediate A, B for computations of the mean molar mass of the layer [mol/kg]184 real ,allocatable :: vmr_co2_gcm(:,:) ! Physics x Times co2 volume mixing ratio retrieve from the gcm [m^3/m^3]193 real,save :: A , B, mmean ! Molar mass: intermediate A, B for computations of the mean molar mass of the layer [mol/kg] 194 real ,allocatable :: vmr_co2_gcm(:,:) ! Physics x Times co2 volume mixing ratio retrieve from the gcm [m^3/m^3] 185 195 real ,allocatable :: vmr_co2_pem_phys(:,:) ! Physics x Times co2 volume mixing ratio used in the PEM 186 196 real ,allocatable :: q_co2_PEM_phys(:,:) ! Physics x Times co2 mass mixing ratio in the first layer computed in the PEM, first value comes from GCM [kg/kg] 187 REAL ,allocatable :: q_h2o_PEM_phys(:,:) ! Physics x Times: h2o mass mixing ratio computed in the PEM, first value comes from GCM [kg/kg]197 REAL ,allocatable :: q_h2o_PEM_phys(:,:) ! Physics x Times: h2o mass mixing ratio computed in the PEM, first value comes from GCM [kg/kg] 188 198 integer :: timelen ! # time samples 189 199 REAL :: ave ! intermediate varibale to compute average … … 194 204 195 205 !!!!!!!!!!!!!!!!!!!!!!!! SLOPE 196 REAL :: watercap_saved! Value saved at the previous time step197 REAL , dimension(:,:), allocatable :: min_co2_ice_1! ngrid field : minimum of co2 ice at each point for the first year [kg/m^2]198 REAL , dimension(:,:), allocatable :: min_co2_ice_2! ngrid field : minimum of co2 ice at each point for the second year [kg/m^2]199 REAL , dimension(:,:), allocatable :: min_h2o_ice_1! ngrid field : minimum of water ice at each point for the first year [kg/m^2]200 REAL , dimension(:,:), allocatable :: min_h2o_ice_2! ngrid field : minimum of water ice at each point for the second year [kg/m^2]201 REAL , dimension(:,:,:), allocatable :: co2_ice_GCM! Physics x NSLOPE x Times field : co2 ice given by the GCM [kg/m^2]202 REAL, dimension(:,:), allocatable :: initial_co2_ice_sublim! physical point field : Logical array indicating sublimating point of co2 ice203 REAL, dimension(:,:), allocatable :: initial_h2o_ice! physical point field : Logical array indicating if there is water ice at initial state204 REAL, dimension(:,:), allocatable :: initial_co2_ice! physical point field : Logical array indicating if there is co2 ice at initial state205 REAL, dimension(:,:), allocatable :: tendencies_co2_ice! physical point xslope field : Tendency of evolution of perenial co2 ice over a year206 REAL, dimension(:,:), allocatable :: tendencies_co2_ice_ini! physical point x slope field x nslope: Tendency of evolution of perenial co2 ice over a year in the GCM207 REAL, dimension(:,:), allocatable :: tendencies_h2o_ice! physical pointx slope field : Tendency of evolution of perenial h2o ice208 REAL , dimension(:,:), allocatable :: flag_co2flow(:,:) !(ngrid,nslope) ! To flag where there is a glacier flow209 REAL , dimension(:), allocatable :: flag_co2flow_mesh(:) !(ngrid) ! To flag where there is a glacier flow206 REAL :: watercap_saved ! Value saved at the previous time step 207 REAL, dimension(:,:), allocatable :: min_co2_ice_1 ! ngrid field : minimum of co2 ice at each point for the first year [kg/m^2] 208 REAL, dimension(:,:), allocatable :: min_co2_ice_2 ! ngrid field : minimum of co2 ice at each point for the second year [kg/m^2] 209 REAL, dimension(:,:), allocatable :: min_h2o_ice_1 ! ngrid field : minimum of water ice at each point for the first year [kg/m^2] 210 REAL, dimension(:,:), allocatable :: min_h2o_ice_2 ! ngrid field : minimum of water ice at each point for the second year [kg/m^2] 211 REAL, dimension(:,:,:),allocatable :: co2_ice_GCM ! Physics x NSLOPE x Times field : co2 ice given by the GCM [kg/m^2] 212 REAL, dimension(:,:), allocatable :: initial_co2_ice_sublim ! physical point field : Logical array indicating sublimating point of co2 ice 213 REAL, dimension(:,:), allocatable :: initial_h2o_ice ! physical point field : Logical array indicating if there is water ice at initial state 214 REAL, dimension(:,:), allocatable :: initial_co2_ice ! physical point field : Logical array indicating if there is co2 ice at initial state 215 REAL, dimension(:,:), allocatable :: tendencies_co2_ice ! physical point xslope field : Tendency of evolution of perenial co2 ice over a year 216 REAL, dimension(:,:), allocatable :: tendencies_co2_ice_ini ! physical point x slope field x nslope: Tendency of evolution of perenial co2 ice over a year in the GCM 217 REAL, dimension(:,:), allocatable :: tendencies_h2o_ice ! physical pointx slope field : Tendency of evolution of perenial h2o ice 218 REAL, dimension(:,:), allocatable :: flag_co2flow(:,:) !(ngrid,nslope): Flag where there is a glacier flow 219 REAL, dimension(:), allocatable :: flag_co2flow_mesh(:) !(ngrid) : Flag where there is a glacier flow 210 220 211 221 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!! SURFACE/SOIL … … 213 223 REAL, ALLOCATABLE :: tsurf_ave(:,:) ! Physic x SLOPE field : Averaged Surface Temperature [K] 214 224 REAL, ALLOCATABLE :: tsoil_ave(:,:,:) ! Physic x SOIL x SLOPE field : Averaged Soil Temperature [K] 215 REAL, ALLOCATABLE :: tsoil_ave_yr1(:,:,:) ! Physics x SLOPE field : Averaged Soil Temperature during 1st year [K]216 REAL, ALLOCATABLE :: tsoil_ave_PEM_yr1(:,:,:)217 225 REAL, ALLOCATABLE :: tsurf_GCM_timeseries(:,:,:) ! ngrid x SLOPE XTULES field : Surface Temperature in timeseries [K] 218 226 … … 225 233 REAL,ALLOCATABLE :: Tsurf_locslope(:) ! Physic x Soil: Intermediate surface temperature to compute Tsoil [K] 226 234 REAL,ALLOCATABLE :: watersoil_density_timeseries(:,:,:,:) ! Physic x Soil x Slope x Times water soil density, time series [kg /m^3] 227 REAL,ALLOCATABLE :: watersurf_density_ave(:,:) ! Physic x Slope, water surface density, yearly averaged [kg/m^3]235 REAL,ALLOCATABLE :: watersurf_density_ave(:,:) ! Physic x Slope, water surface density, yearly averaged [kg/m^3] 228 236 REAL,ALLOCATABLE :: watersoil_density_PEM_timeseries(:,:,:,:) ! Physic x Soil x Slope x Times, water soil density, time series [kg/m^3] 229 237 REAL,ALLOCATABLE :: watersoil_density_PEM_ave(:,:,:) ! Physic x Soil x SLopes, water soil density, yearly averaged [kg/m^3] 230 REAL,ALLOCATABLE :: Tsurfave_before_saved(:,:) 231 REAL, ALLOCATABLE :: delta_co2_adsorbded(:) 232 REAL, ALLOCATABLE :: delta_h2o_adsorbded(:) 233 REAL :: totmassco2_adsorbded 234 REAL :: totmassh2o_adsorbded 235 LOGICAL :: bool_sublim 238 REAL,ALLOCATABLE :: Tsurfave_before_saved(:,:) ! Surface temperature saved from previous time step [K] 239 REAL, ALLOCATABLE :: delta_co2_adsorbded(:) ! Physics: quantity of CO2 that is exchanged because of adsorption / desorption [kg/m^2] 240 REAL, ALLOCATABLE :: delta_h2o_adsorbded(:) ! Physics: quantity of H2O that is exchanged because of adsorption / desorption [kg/m^2] 241 REAL :: totmassco2_adsorbded ! Total mass of CO2 that is exchanged because of adsorption / desoprtion over the planets [kg] 242 REAL :: totmassh2o_adsorbded ! Total mass of H2O that is exchanged because of adsorption / desoprtion over the planets [kg] 243 LOGICAL :: bool_sublim ! logical to check if there is sublimation or not 236 244 237 245 … … 249 257 REAL :: albedo_h2o_frost ! albedo of h2o frost 250 258 REAL,ALLOCATABLE :: co2ice(:) ! Physics: co2 ice mesh averaged [kg/m^2] 259 #endif 260 261 #ifdef CPP_1D 262 INTEGER :: nsplit_phys 263 integer,parameter:: jjm_value=jjm-1 264 integer :: ierr 265 #else 266 integer,parameter:: jjm_value=jjm 251 267 #endif 252 268 … … 277 293 year_day=669 278 294 daysec=88775. 279 dtphys=0280 295 timestep=year_day*daysec/year_step 281 296 … … 288 303 289 304 !----------------------------READ run.def --------------------- 305 306 #ifndef CPP_1D 307 dtphys=0 290 308 CALL conf_gcm( 99, .TRUE. ) 309 call infotrac_init 310 nq=nqtot 311 allocate(q(ip1jmp1,llm,nqtot)) 312 #else 313 ! load tracer names from file 'traceur.def' 314 open(90,file='traceur.def',status='old',form='formatted',& 315 iostat=ierr) 316 if (ierr.ne.0) then 317 write(*,*) 'Cannot find required file "traceur.def"' 318 write(*,*) ' If you want to run with tracers, I need it' 319 write(*,*) ' ... might as well stop here ...' 320 stop 321 else 322 write(*,*) "pem1d: Reading file traceur.def" 323 ! read number of tracers: 324 read(90,*,iostat=ierr) nq 325 print *, "nq",nq 326 nqtot=nq ! set value of nqtot (in infotrac module) as nq 327 if (ierr.ne.0) then 328 write(*,*) "pem1d: error reading number of tracers" 329 write(*,*) " (first line of traceur.def) " 330 stop 331 endif 332 if (nq<1) then 333 write(*,*) "pem1d: error number of tracers" 334 write(*,*) "is nq=",nq," but must be >=1!" 335 stop 336 endif 337 endif 338 nq=nqtot 339 allocate(q(ip1jmp1,llm,nqtot)) 340 allocate(ap(nlayer+1)) 341 allocate(bp(nlayer+1)) 342 call init_phys_1d(llm,nqtot,vcov,ucov, & 343 teta,q,ps, time_0,ap,bp) 344 pi=2.E+0*asin(1.E+0) 345 g=3.72 346 nsplit_phys=1 347 #endif 291 348 CALL conf_pem 292 349 293 call infotrac_init294 nq=nqtot295 296 350 !------------------------ 297 351 … … 306 360 !----------------------------READ start.nc --------------------- 307 361 308 allocate(q(ip1jmp1,llm,nqtot)) 362 363 #ifndef CPP_1D 309 364 CALL dynetat0(FILE_NAME_start,vcov,ucov, & 310 365 teta,q,masse,ps,phis, time_0) 366 #endif 311 367 312 368 allocate(ps_start_GCM(ngrid)) 369 #ifndef CPP_1D 313 370 call gr_dyn_fi(1,iip1,jjp1,ngridmx,ps,ps_start_GCM) 314 371 315 372 CALL iniconst !new 316 373 CALL inigeom 374 317 375 allocate(ap(nlayer+1)) 318 376 allocate(bp(nlayer+1)) … … 324 382 status =nf90_close(ncid) 325 383 384 #else 385 386 ps_start_GCM(1)=ps(1) 387 388 #endif 389 390 391 #ifndef CPP_1D 326 392 CALL iniphysiq(iim,jjm,llm, & 327 393 (jjm-1)*iim+2,comm_lmdz, & … … 329 395 rlatu,rlatv,rlonu,rlonv,aire,cu,cv,rad,g,r,cpp, & 330 396 iflag_phys) 397 #endif 331 398 332 399 ! In the gcm, these values are given to the physic by the dynamic. … … 470 537 allocate(tsurf_ave_yr1(ngrid,nslope)) 471 538 allocate(tsurf_ave(ngrid,nslope)) 472 allocate(tsoil_ave_yr1(ngrid,nsoilmx,nslope))473 539 allocate(tsoil_ave(ngrid,nsoilmx,nslope)) 474 540 allocate(tsurf_GCM_timeseries(ngrid,nslope,timelen)) … … 480 546 allocate(watersoil_density_timeseries(ngrid,nsoilmx,nslope,timelen)) 481 547 482 allocate(tsoil_ave_PEM_yr1(ngrid,nsoilmx_PEM,nslope))483 548 allocate(Tsurfave_before_saved(ngrid,nslope)) 484 549 allocate(tsoil_phys_PEM_timeseries(ngrid,nsoilmx_PEM,nslope,timelen)) … … 491 556 print *, "Downloading data Y1..." 492 557 493 call read_data_GCM("data_GCM_Y1.nc",timelen, iim,jjm ,ngrid,nslope,vmr_co2_gcm,ps_timeseries,min_co2_ice_1,min_h2o_ice_1,&494 tsurf_ave_yr1,tsoil_ave _yr1, tsurf_GCM_timeseries,tsoil_GCM_timeseries,q_co2_PEM_phys,q_h2o_PEM_phys,co2_ice_GCM, &558 call read_data_GCM("data_GCM_Y1.nc",timelen, iim,jjm_value,ngrid,nslope,vmr_co2_gcm,ps_timeseries,min_co2_ice_1,min_h2o_ice_1,& 559 tsurf_ave_yr1,tsoil_ave, tsurf_GCM_timeseries,tsoil_GCM_timeseries,q_co2_PEM_phys,q_h2o_PEM_phys,co2_ice_GCM, & 495 560 watersurf_density_ave,watersoil_density_timeseries) 496 561 … … 500 565 print *, "Downloading data Y2" 501 566 502 call read_data_GCM("data_GCM_Y2.nc",timelen,iim,jjm ,ngrid,nslope,vmr_co2_gcm,ps_timeseries,min_co2_ice_2,min_h2o_ice_2, &567 call read_data_GCM("data_GCM_Y2.nc",timelen,iim,jjm_value,ngrid,nslope,vmr_co2_gcm,ps_timeseries,min_co2_ice_2,min_h2o_ice_2, & 503 568 tsurf_ave,tsoil_ave, tsurf_GCM_timeseries,tsoil_GCM_timeseries,q_co2_PEM_phys,q_h2o_PEM_phys,co2_ice_GCM, & 504 569 watersurf_density_ave,watersoil_density_timeseries) … … 529 594 call soil_settings_PEM(ngrid,nslope,nsoilmx_PEM,nsoilmx,inertiesoil,TI_PEM) 530 595 DO l=1,nsoilmx 531 tsoil_ave_PEM_yr1(:,l,:)=tsoil_ave_yr1(:,l,:)532 596 tsoil_PEM(:,l,:)=tsoil_ave(:,l,:) 533 597 tsoil_phys_PEM_timeseries(:,l,:,:)=tsoil_GCM_timeseries(:,l,:,:) … … 535 599 ENDDO 536 600 DO l=nsoilmx+1,nsoilmx_PEM 537 tsoil_ave_PEM_yr1(:,l,:)=tsoil_ave_yr1(:,nsoilmx,:)538 601 tsoil_PEM(:,l,:)=tsoil_ave(:,nsoilmx,:) 539 602 watersoil_density_PEM_timeseries(:,l,:,:)=watersoil_density_timeseries(:,nsoilmx,:,:) 540 603 ENDDO 541 604 watersoil_density_PEM_ave(:,:,:) = SUM(watersoil_density_PEM_timeseries(:,:,:,:),4)/timelen 542 deallocate(tsoil_ave_yr1)543 605 deallocate(tsoil_ave) 544 606 deallocate(tsoil_GCM_timeseries) … … 656 718 !---------------------------- Read the PEMstart --------------------- 657 719 658 call pemetat0("startfi_PEM.nc",ngrid,nsoilmx,nsoilmx_PEM,nslope,timelen,timestep,TI_PEM,tsoil_ ave_PEM_yr1,tsoil_PEM,porefillingice_depth,porefillingice_thickness, &720 call pemetat0("startfi_PEM.nc",ngrid,nsoilmx,nsoilmx_PEM,nslope,timelen,timestep,TI_PEM,tsoil_PEM,porefillingice_depth,porefillingice_thickness, & 659 721 tsurf_ave_yr1, tsurf_ave, q_co2_PEM_phys, q_h2o_PEM_phys,ps_timeseries,tsoil_phys_PEM_timeseries,& 660 722 tendencies_h2o_ice,tendencies_co2_ice,qsurf(:,igcm_co2,:),qsurf(:,igcm_h2o_ice,:),global_ave_press_GCM,& … … 687 749 write(*,*) "Tot mass of H2O in the regolith=", totmassh2o_adsorbded 688 750 endif ! adsorption 689 deallocate(tsoil_ave_PEM_yr1)690 751 deallocate(tsurf_ave_yr1) 691 752 … … 702 763 ! I_h Read the PEMstar 703 764 ! I_i Compute orbit criterion 765 704 766 #ifndef CPP_STD 705 767 CALL iniorbit(aphelie,periheli,year_day,peri_day,obliquit) … … 813 875 print *, "Evolution of h2o ice" 814 876 815 call evol_h2o_ice_s _slope(qsurf(:,igcm_h2o_ice,:),tendencies_h2o_ice,iim,jjm,ngrid,cell_area,STOPPING_1_water,nslope)877 call evol_h2o_ice_s(qsurf(:,igcm_h2o_ice,:),tendencies_h2o_ice,iim,jjm_value,ngrid,cell_area,STOPPING_1_water,nslope) 816 878 817 879 DO islope=1, nslope … … 822 884 823 885 print *, "Evolution of co2 ice" 824 call evol_co2_ice_s _slope(qsurf(:,igcm_co2,:),tendencies_co2_ice,iim,jjm,ngrid,cell_area,STOPPING_1_co2,nslope)886 call evol_co2_ice_s(qsurf(:,igcm_co2,:),tendencies_co2_ice,iim,jjm_value,ngrid,cell_area,nslope) 825 887 826 888 !------------------------ … … 839 901 global_ave_press_GCM,global_ave_press_new,qsurf(:,igcm_co2,:),flag_co2flow,flag_co2flow_mesh) 840 902 endif 841 842 843 903 844 904 DO islope=1, nslope … … 1031 1091 criterion_stop=2 1032 1092 endif 1033 if (STOPPING_1_co2) then1034 print *, "STOPPING because tendencies on co2 ice=0, see message above", STOPPING_1_co21035 criterion_stop=21036 endif1037 1093 if (STOPPING_pressure) then 1038 1094 print *, "STOPPING because surface global pressure changed too much, see message above", STOPPING_pressure … … 1044 1100 endif 1045 1101 1046 if (STOPPING_water .or. STOPPING_1_water .or. STOPPING_co2 .or. STOPPING_ 1_co2 .or. STOPPING_pressure) then1102 if (STOPPING_water .or. STOPPING_1_water .or. STOPPING_co2 .or. STOPPING_pressure) then 1047 1103 exit 1048 1104 else … … 1181 1237 enddo 1182 1238 enddo 1183 1239 1184 1240 !------------------------ 1185 1241 if(evol_orbit_pem) then … … 1200 1256 1201 1257 allocate(p(ip1jmp1,nlayer+1)) 1258 #ifndef CPP_1D 1202 1259 CALL pression (ip1jmp1,ap,bp,ps,p) 1203 1260 CALL massdair(p,masse) … … 1208 1265 time_0,vcov,ucov,teta,q,masse,ps) 1209 1266 print *, "restart_evol.nc has been written" 1267 1268 #else 1269 DO nnq = 1, nqtot 1270 call writeprofile(nlayer,q(1,:,nnq),noms(nnq),nnq) 1271 ENDDO 1272 #endif 1210 1273 1211 1274 ! III_b.2 WRITE restartfi.nc -
trunk/LMDZ.COMMON/libf/evolution/pemetat0.F90
r2961 r2980 1 SUBROUTINE pemetat0(filename,ngrid,nsoil_GCM,nsoil_PEM,nslope,timelen,timestep,TI_PEM,tsoil_PEM _yr1,tsoil_PEM,ice_table, ice_table_thickness, &1 SUBROUTINE pemetat0(filename,ngrid,nsoil_GCM,nsoil_PEM,nslope,timelen,timestep,TI_PEM,tsoil_PEM,ice_table, ice_table_thickness, & 2 2 tsurf_ave_yr1,tsurf_ave_yr2,q_co2,q_h2o,ps_inst,tsoil_inst,tend_h2oglaciers,tend_co2glaciers,co2ice,waterice, & 3 3 global_ave_pressure,watersurf_ave,watersoil_ave, m_co2_regolith_phys,deltam_co2_regolith_phys, & … … 35 35 real,intent(in) :: co2ice(ngrid,nslope) ! co2 ice amount [kg/m^2] 36 36 real,intent(in) :: waterice(ngrid,nslope) ! water ice amount [kg/m^2] 37 real, intent(in) :: tsoil_PEM_yr1(ngrid,nsoil_PEM,nslope) ! soil temperature during 1st year [K]38 37 real, intent(in) :: watersurf_ave(ngrid,nslope) ! surface water ice density, yearly averaged (kg/m^3) 39 38 real, intent(inout) :: watersoil_ave(ngrid,nsoil_PEM,nslope)! surface water ice density, yearly averaged (kg/m^3) -
trunk/LMDZ.COMMON/libf/evolution/read_data_GCM.F90
r2963 r2980 1 !2 ! $Id $3 !4 1 SUBROUTINE read_data_GCM(fichnom,timelen, iim_input,jjm_input,ngrid,nslope,vmr_co2_gcm_phys,ps_timeseries, & 5 2 min_co2_ice,min_h2o_ice,tsurf_ave,tsoil_ave,tsurf_gcm,tsoil_gcm,q_co2,q_h2o,co2_ice_slope, & … … 28 25 CHARACTER(LEN=*), INTENT(IN) :: fichnom !--- FILE NAME 29 26 INTEGER, INTENT(IN) :: timelen ! number of times stored in the file 30 INTEGER :: iim_input,jjm_input,ngrid,nslope 27 INTEGER :: iim_input,jjm_input,ngrid,nslope ! number of points in the lat x lon dynamical grid, number of subgrid slopes 31 28 ! Ouputs 32 29 REAL, INTENT(OUT) :: min_co2_ice(ngrid,nslope) ! Minimum of co2 ice per slope of the year [kg/m^2] … … 105 102 print *, "Downloading data for surface pressure done" 106 103 print *, "nslope=", nslope 104 105 if(nslope.gt.1) then 106 107 107 print *, "Downloading data for co2ice_slope ..." 108 109 if(nslope.gt.1) then110 108 111 109 DO islope=1,nslope … … 178 176 call get_var3("tsurf", tsurf_gcm_dyn(:,:,1,:)) 179 177 #ifndef CPP_STD 180 call get_var3("watercap", watercap_slope(:,:,1,:)) 178 ! call get_var3("watercap", watercap_slope(:,:,1,:)) 179 watercap_slope(:,:,1,:)=1. 181 180 #endif 182 181 … … 198 197 tsurf_ave_dyn(:,:,:)=SUM(tsurf_gcm_dyn(:,:,:,:),4)/timelen 199 198 199 #ifndef CPP_1D 200 200 DO islope = 1,nslope 201 201 DO t=1,timelen … … 203 203 ENDDO 204 204 ENDDO 205 #endif 205 206 206 207 if(soil_pem) then … … 213 214 ! By definition, a density is positive, we get rid of the negative values 214 215 DO i=1,iim+1 215 DO j = 1, jjm +1216 DO j = 1, jjm_input+1 216 217 DO islope=1,nslope 217 218 if (min_co2_ice_dyn(i,j,islope).LT.0) then … … 226 227 227 228 DO i=1,iim+1 228 DO j = 1, jjm +1229 DO j = 1, jjm_input+1 229 230 DO t = 1, timelen 230 231 if (q_co2_dyn(i,j,t).LT.0) then … … 243 244 ENDDO 244 245 ENDDO 246 247 #ifndef CPP_1D 245 248 246 249 CALL gr_dyn_fi(timelen,iim_input+1,jjm_input+1,ngrid,vmr_co2_gcm,vmr_co2_gcm_phys) … … 269 272 CALL gr_dyn_fi(nslope,iim_input+1,jjm_input+1,ngrid,tsurf_ave_dyn,tsurf_ave) 270 273 274 #else 275 276 vmr_co2_gcm_phys(1,:)=vmr_co2_gcm(1,1,:) 277 ps_timeseries(1,:)=ps_GCM(1,1,:) 278 q_co2(1,:)=q_co2_dyn(1,1,:) 279 q_h2o(1,:)=q_h2o_dyn(1,1,:) 280 min_co2_ice(1,:)=min_co2_ice_dyn(1,1,:) 281 min_h2o_ice(1,:)=min_h2o_ice_dyn(1,1,:) 282 if(soil_pem) then 283 tsoil_ave(1,:,:)=tsoil_ave_dyn(1,1,:,:) 284 tsoil_gcm(1,:,:,:)=tsoil_gcm_dyn(1,1,:,:,:) 285 watersoil_density(1,:,:,:)=watersoil_density_dyn(1,1,:,:,:) 286 endif !soil_pem 287 tsurf_GCM(1,:,:)=tsurf_GCM_dyn(1,1,:,:) 288 co2_ice_slope(1,:,:)=co2_ice_slope_dyn(1,1,:,:) 289 tsurf_ave(1,:)=tsurf_ave_dyn(1,1,:) 290 291 #endif 292 271 293 CONTAINS 272 294 -
trunk/LMDZ.COMMON/libf/evolution/recomp_orb_param_mod.F90
r2963 r2980 3 3 ! 4 4 ! Purpose: Recompute orbit parameters based on values by Laskar et al., 5 ! 20046 5 ! 7 ! Author s: RV6 ! Author: RV 8 7 !======================================================================= 9 8 IMPLICIT NONE … … 48 47 real :: unitastr 49 48 49 real xa,xb,xc,ya,yb 50 50 51 51 52 ! ********************************************************************** … … 66 67 print *, "recomp_orb_param, Old timeperi=", timeperi 67 68 69 xc=Year 70 68 71 do ilask=last_ilask,1,-1 72 73 xa=yearlask(ilask) 74 xb=yearlask(ilask+1) 75 69 76 if(yearlask(ilask) .GT.Year) then 70 77 if(var_obl) then 71 obliquit=oblask(ilask+1)+(oblask(ilask)-oblask(ilask+1))*(Year-yearlask(ilask+1))/(yearlask(ilask)-yearlask(ilask+1)) 78 ya=oblask(ilask) 79 yb=oblask(ilask+1) 80 obliquit=ya*(xc-xb)/(xa-xb)+yb*(xa-xc)/(xa-xb) 72 81 endif 73 82 if(var_ex) then 74 e_elips=exlask(ilask+1)+(exlask(ilask)-exlask(ilask+1))*(Year-yearlask(ilask+1))/(yearlask(ilask)-yearlask(ilask+1)) 83 ya=exlask(ilask) 84 yb=exlask(ilask+1) 85 e_elips=ya*(xc-xb)/(xa-xb)+yb*(xa-xc)/(xa-xb) 75 86 endif 76 87 if(var_lsp) then … … 82 93 endif 83 94 endif 84 timeperi_ls=lsplask(ilask+1)+(lsplask(ilask)-lsplask(ilask+1))*(Year-yearlask(ilask+1))/(yearlask(ilask)-yearlask(ilask+1)) 85 timeperi_ls=modulo(timeperi_ls,360.) 95 96 ya=lsplask(ilask) 97 yb=lsplask(ilask+1) 98 timeperi_ls=ya*(xc-xb)/(xa-xb)+yb*(xa-xc)/(xa-xb) 99 timeperi_ls=modulo(timeperi_ls,360.) 100 halfaxe=227.94 101 timeperi=timeperi_ls*2*pi/360 102 periheli = halfaxe*(1-e_elips) 103 aphelie = halfaxe*(1+e_elips) 104 unitastr=149.597927 105 p_elips=0.5*(periheli+aphelie)*(1-e_elips*e_elips)/unitastr 106 107 call call_dayperi(timeperi,e_elips,peri_day,year_day) 86 108 endif 87 109 exit 88 110 endif 89 111 enddo 90 halfaxe=227.9491 timeperi=timeperi_ls*2*pi/36092 periheli = halfaxe*(1-e_elips)93 aphelie = halfaxe*(1+e_elips)94 unitastr=149.59792795 p_elips=0.5*(periheli+aphelie)*(1-e_elips*e_elips)/unitastr96 call call_dayperi(timeperi,e_elips,peri_day,year_day)97 112 98 113 print *, "recomp_orb_param, Final year of the PEM run:", Year -
trunk/LMDZ.COMMON/libf/evolution/recomp_tend_co2_slope.F90
r2945 r2980 27 27 REAL, intent(in) :: tendencies_co2_ice_phys_ini(ngrid,nslope) ! physical point field : Evolution of perenial ice over one year 28 28 REAL, intent(in) :: co2ice_slope(ngrid,nslope) ! CO2 ice per mesh and sub-grid slope(kg/m^2) 29 REAL, intent(in) :: emissivity_slope(ngrid,nslope) ! Emissivity per mesh and sub-grid slope(1)29 REAL, intent(in) :: emissivity_slope(ngrid,nslope) ! Emissivity per mesh and sub-grid slope(1) 30 30 31 31 ! OUTPUT … … 43 43 coef=sols_per_my*sec_per_sol*emissivity_slope(i,islope)*sigmaB/Lco2 44 44 ave=0. 45 ! if(abs(tendencies_co2_ice_phys(i,islope)).gt.1e-4) then46 45 if(co2ice_slope(i,islope).gt.1e-4 .and. abs(tendencies_co2_ice_phys(i,islope)).gt.1e-5) then 47 46 do t=1,timelen -
trunk/LMDZ.COMMON/libf/evolution/reshape_XIOS_output.F90
r2963 r2980 80 80 status = nf90_inquire_dimension(ncid1, dimids(i), name_, len_) 81 81 if(status /= nf90_noerr) call handle_err(status) 82 if(name_.eq."lon" ) then82 if(name_.eq."lon" .or. name_.eq."longitude") then 83 83 dimid_lon=dimids(i) 84 84 len_lon=len_ 85 85 len_=len_+1 86 elseif(name_.eq."lat" ) then86 elseif(name_.eq."lat".or. name_.eq."latitude") then 87 87 dimid_lat=dimids(i) 88 88 len_lat=len_ 89 elseif(name_.eq."time_counter" ) then89 elseif(name_.eq."time_counter".or. name_.eq. "Time") then 90 90 dimid_time=dimids(i) 91 91 len_time=len_ 92 elseif(name_.eq."soil_layers" ) then92 elseif(name_.eq."soil_layers".or. name_.eq. "subsurface_layers") then 93 93 dimid_soil=dimids(i) 94 94 len_soil=len_ … … 98 98 dimids_2(i)=dimid_2 99 99 enddo 100 101 102 103 allocate(tempvalues_3d(len_lon,len_lat,len_time))104 allocate(values_3d(len_lon+1,len_lat,len_time))105 106 allocate(tempvalues_4d(len_lon,len_lat,len_soil,len_time))107 allocate(values_4d(len_lon+1,len_lat,len_soil,len_time))108 109 100 110 101 do i=1,nvars … … 186 177 endif 187 178 elseif(numdims.eq.3) then 179 allocate(tempvalues_3d(len_lon,len_lat,len_time)) 180 allocate(values_3d(len_lon+1,len_lat,len_time)) 188 181 status = nf90_get_var(ncid1, varids(i), tempvalues_3d) 189 182 if(status /= nf90_noerr) call handle_err(status) … … 198 191 status = nf90_redef(ncid2) 199 192 if(status /= nf90_noerr) call handle_err(status) 193 deallocate(tempvalues_3d) 194 deallocate(values_3d) 200 195 elseif(numdims.eq.4) then 196 allocate(tempvalues_4d(len_lon,len_lat,len_soil,len_time)) 197 allocate(values_4d(len_lon+1,len_lat,len_soil,len_time)) 201 198 status = nf90_get_var(ncid1, varids(i), tempvalues_4d) 202 199 if(status /= nf90_noerr) call handle_err(status) … … 211 208 status = nf90_redef(ncid2) 212 209 if(status /= nf90_noerr) call handle_err(status) 210 deallocate(tempvalues_4d) 211 deallocate(values_4d) 213 212 endif 214 213 … … 228 227 deallocate(dimids_2) 229 228 deallocate(varids_2) 230 deallocate(tempvalues_3d)231 deallocate(values_3d)232 deallocate(tempvalues_4d)233 deallocate(values_4d)234 235 236 229 237 230 enddo
Note: See TracChangeset
for help on using the changeset viewer.