[38] | 1 | SUBROUTINE surfini(ngrid,piceco2,qsurf,psolaralb) |
---|
[520] | 2 | ! to use 'getin' |
---|
| 3 | USE ioipsl_getincom |
---|
[697] | 4 | use netcdf |
---|
[1224] | 5 | use tracer_mod, only: nqmx, noms |
---|
[1543] | 6 | use geometry_mod, only: longitude, latitude ! in radians |
---|
[1047] | 7 | use surfdat_h, only: watercaptag, frost_albedo_threshold, |
---|
| 8 | & albedo_h2o_ice, inert_h2o_ice, albedodat, |
---|
[1224] | 9 | & albedice, dryness |
---|
[1212] | 10 | #ifndef MESOSCALE |
---|
[1130] | 11 | use mod_grid_phy_lmdz, only : klon_glo ! # of physics point on full grid |
---|
| 12 | use mod_phys_lmdz_para, only : is_master, gather, scatter |
---|
[1212] | 13 | #endif |
---|
[1226] | 14 | USE comcstfi_h |
---|
[1528] | 15 | use mod_grid_phy_lmdz, only: nbp_lon, nbp_lat |
---|
[38] | 16 | IMPLICIT NONE |
---|
| 17 | c======================================================================= |
---|
| 18 | c |
---|
| 19 | c creation des calottes pour l'etat initial |
---|
| 20 | c |
---|
| 21 | c======================================================================= |
---|
| 22 | c----------------------------------------------------------------------- |
---|
| 23 | c Declarations: |
---|
| 24 | c ------------- |
---|
| 25 | #include "callkeys.h" |
---|
[669] | 26 | #include "datafile.h" |
---|
| 27 | |
---|
[1130] | 28 | integer,intent(in) :: ngrid ! number of atmospheric columns |
---|
| 29 | real,intent(in) :: piceco2(ngrid) ! CO2 ice thickness |
---|
| 30 | real,intent(inout) :: qsurf(ngrid,nqmx) ! tracer on surface (kg/m2) |
---|
| 31 | real,intent(out) :: psolaralb(ngrid,2) ! albedo |
---|
| 32 | |
---|
| 33 | INTEGER ig,icap,iq,alternate |
---|
[520] | 34 | REAL icedryness ! ice dryness |
---|
[633] | 35 | |
---|
| 36 | ! longwatercaptag is watercaptag. Trick for some compilers |
---|
| 37 | LOGICAL, DIMENSION(100000) :: longwatercaptag |
---|
[520] | 38 | |
---|
[669] | 39 | ! There are 3 different modes for ice distribution: |
---|
| 40 | ! icelocationmode = 1 ---> based on data from surface.nc |
---|
| 41 | ! icelocationmode = 2 ---> directly predefined for GCM resolutions 32x24 or 64x48 |
---|
| 42 | ! icelocationmode = 3 ---> based on logical relations for latitude and longitude |
---|
| 43 | ! For visualisation : > /u/tnalmd/bin/watercaps gcm_txt_output_file |
---|
| 44 | INTEGER,SAVE :: icelocationmode = 2 |
---|
| 45 | |
---|
| 46 | |
---|
| 47 | !in case icelocationmode == 1 |
---|
| 48 | INTEGER i,j |
---|
| 49 | INTEGER imd,jmd |
---|
| 50 | PARAMETER (imd=360,jmd=180) |
---|
[712] | 51 | REAL zdata(imd,jmd) |
---|
[669] | 52 | REAL zelat,zelon |
---|
| 53 | |
---|
[1212] | 54 | #ifndef MESOSCALE |
---|
[1207] | 55 | INTEGER nb_ice(klon_glo,2) ! number of counts | detected ice for GCM grid |
---|
[1212] | 56 | #endif |
---|
[1528] | 57 | INTEGER latice(nbp_lat-1,2),lonice (nbp_lon,2) ! number of counts | detected ice along lat & lon axis |
---|
[669] | 58 | |
---|
| 59 | REAL step,count,ratiolat |
---|
| 60 | |
---|
| 61 | INTEGER ierr,nid,nvarid |
---|
| 62 | |
---|
| 63 | REAL,SAVE :: min_icevalue = 500. |
---|
[697] | 64 | character(len=50) :: string = 'thermal' |
---|
[669] | 65 | |
---|
| 66 | character (len=100) :: zedatafile |
---|
[1130] | 67 | |
---|
[1212] | 68 | #ifdef MESOSCALE |
---|
| 69 | |
---|
| 70 | do ig=1,ngrid |
---|
| 71 | |
---|
| 72 | !write(*,*) "all qsurf to zero. dirty." |
---|
| 73 | do iq=1,nqmx |
---|
| 74 | qsurf(ig,iq)=0. !! on jette les inputs GCM |
---|
| 75 | !! on regle juste watercaptag |
---|
| 76 | !! il faudrait garder les inputs GCM |
---|
| 77 | !! si elles sont consequentes |
---|
| 78 | enddo |
---|
[1541] | 79 | if ( ( latitude(ig)*180./pi .gt. 70. ) .and. |
---|
[1212] | 80 | . ( albedodat(ig) .ge. 0.26 ) ) then |
---|
| 81 | write(*,*)"outlier ",ig |
---|
| 82 | watercaptag(ig) = .true. |
---|
| 83 | dryness(ig) = 1. |
---|
| 84 | albedodat(ig) = albedo_h2o_ice !! pour output |
---|
| 85 | else |
---|
| 86 | watercaptag(ig) = .false. |
---|
| 87 | dryness(ig) = 1. |
---|
| 88 | endif |
---|
| 89 | |
---|
| 90 | enddo |
---|
| 91 | #endif |
---|
| 92 | ! problem with nested precompiling flags |
---|
| 93 | |
---|
| 94 | #ifndef MESOSCALE |
---|
[1130] | 95 | ! to handle parallel cases |
---|
| 96 | #if CPP_PARA |
---|
| 97 | logical watercaptag_glo(klon_glo) |
---|
| 98 | real dryness_glo(klon_glo) |
---|
| 99 | real lati_glo(klon_glo) |
---|
| 100 | real long_glo(klon_glo) |
---|
| 101 | #else |
---|
| 102 | logical watercaptag_glo(ngrid) |
---|
| 103 | real dryness_glo(ngrid) |
---|
| 104 | real lati_glo(ngrid) |
---|
| 105 | real long_glo(ngrid) |
---|
| 106 | #endif |
---|
[1212] | 107 | #endif |
---|
[1130] | 108 | |
---|
[1212] | 109 | #ifndef MESOSCALE |
---|
| 110 | |
---|
[38] | 111 | c |
---|
| 112 | c======================================================================= |
---|
[1130] | 113 | ! Initialize watercaptag (default is false) |
---|
| 114 | watercaptag_glo(:)=.false. |
---|
[38] | 115 | |
---|
[283] | 116 | c water ice outliers |
---|
[38] | 117 | c ------------------------------------------ |
---|
| 118 | |
---|
[283] | 119 | IF ((water) .and. (caps)) THEN |
---|
[285] | 120 | |
---|
[283] | 121 | c Perennial H20 north cap defined by watercaptag=true (allows surface to be |
---|
| 122 | c hollowed by sublimation in vdifc). |
---|
[38] | 123 | |
---|
[283] | 124 | c We might not want albedodat to be modified because it is used to write |
---|
| 125 | c restart files. Instead, albedo is directly modified when needed (i.e. |
---|
| 126 | c if we have watercaptag and no co2 ice), below and in albedocaps.F90 |
---|
| 127 | |
---|
| 128 | c "Dryness coefficient" controlling the evaporation and |
---|
| 129 | c sublimation from the ground water ice (close to 1) |
---|
| 130 | c HERE, the goal is to correct for the fact |
---|
| 131 | c that the simulated permanent water ice polar caps |
---|
| 132 | c is larger than the actual cap and the atmospheric |
---|
| 133 | c opacity not always realistic. |
---|
| 134 | |
---|
| 135 | alternate = 0 |
---|
[520] | 136 | |
---|
[1047] | 137 | if (ngrid .ne. 1) then |
---|
[633] | 138 | watercaptag(:) = .false. |
---|
| 139 | longwatercaptag(:) = .false. |
---|
| 140 | endif |
---|
| 141 | |
---|
[1130] | 142 | write(*,*) "surfini: Ice dryness ?" |
---|
[520] | 143 | icedryness=1. ! default value |
---|
| 144 | call getin("icedryness",icedryness) |
---|
[1130] | 145 | write(*,*) "surfini: icedryness = ",icedryness |
---|
[669] | 146 | dryness (:) = icedryness |
---|
[633] | 147 | |
---|
[1130] | 148 | ! To be able to run in parallel, we work on the full grid |
---|
| 149 | ! and dispatch results afterwards |
---|
[669] | 150 | |
---|
[1130] | 151 | ! start by geting latitudes and logitudes on full grid |
---|
| 152 | ! (in serial mode, this is just a copy) |
---|
[1541] | 153 | call gather(latitude,lati_glo) |
---|
| 154 | call gather(longitude,long_glo) |
---|
[669] | 155 | |
---|
[1130] | 156 | if (is_master) then |
---|
| 157 | |
---|
| 158 | IF (ngrid .eq. 1) THEN ! special case for 1d --> do nothing |
---|
[669] | 159 | |
---|
[1047] | 160 | print*, 'ngrid = 1, do no put ice caps in surfini.F' |
---|
[669] | 161 | |
---|
[1130] | 162 | ELSE IF (icelocationmode .eq. 1) THEN |
---|
[669] | 163 | |
---|
| 164 | print*,'Surfini: ice caps defined from surface.nc' |
---|
| 165 | |
---|
| 166 | ! This method detects ice as gridded value above min_icevalue in the field "string" from surface.nc |
---|
| 167 | ! Typically, it is for thermal inertia above 500 tiu. |
---|
| 168 | ! Two conditions are verified: |
---|
| 169 | ! 1. GCM ice caps are defined such as area is conserved for a given latitude |
---|
| 170 | ! (the approximation is that all points within the GCM latitude resolution have the same area). |
---|
| 171 | ! 2. caps are placed to fill the GCM points with the most detected ice first. |
---|
| 172 | |
---|
| 173 | |
---|
| 174 | |
---|
[1130] | 175 | zedatafile = trim(datafile) |
---|
[669] | 176 | |
---|
| 177 | |
---|
[1130] | 178 | ierr=nf90_open(trim(zedatafile)//'/surface.nc', |
---|
| 179 | & NF90_NOWRITE,nid) |
---|
[669] | 180 | |
---|
[1130] | 181 | IF (ierr.NE.nf90_noerr) THEN |
---|
[669] | 182 | write(*,*)'Error : cannot open file surface.nc ' |
---|
| 183 | write(*,*)'(in phymars/surfini.F)' |
---|
| 184 | write(*,*)'It should be in :',trim(zedatafile),'/' |
---|
| 185 | write(*,*)'1) You can set this path in the callphys.def file:' |
---|
| 186 | write(*,*)' datadir=/path/to/the/datafiles' |
---|
| 187 | write(*,*)'2) If necessary, surface.nc (and other datafiles)' |
---|
| 188 | write(*,*)' can be obtained online on:' |
---|
[1381] | 189 | write(*,*)' http://www.lmd.jussieu.fr/~lmdz/planets/mars/datadir' |
---|
[669] | 190 | CALL ABORT |
---|
[1130] | 191 | ENDIF |
---|
[669] | 192 | |
---|
| 193 | |
---|
[1130] | 194 | ierr=nf90_inq_varid(nid, string, nvarid) |
---|
| 195 | if (ierr.ne.nf90_noerr) then |
---|
| 196 | write(*,*) 'surfini error, cannot find ',trim(string) |
---|
| 197 | write(*,*) ' in file ',trim(zedatafile),'/surface.nc' |
---|
| 198 | write(*,*)trim(nf90_strerror(ierr)) |
---|
| 199 | stop |
---|
| 200 | endif |
---|
[697] | 201 | |
---|
[1130] | 202 | ierr=nf90_get_var(nid, nvarid, zdata) |
---|
[697] | 203 | |
---|
[1130] | 204 | if (ierr.ne.nf90_noerr) then |
---|
| 205 | write(*,*) 'surfini: error failed loading ',trim(string) |
---|
| 206 | write(*,*)trim(nf90_strerror(ierr)) |
---|
| 207 | stop |
---|
| 208 | endif |
---|
[669] | 209 | |
---|
| 210 | |
---|
[1130] | 211 | ierr=nf90_close(nid) |
---|
[669] | 212 | |
---|
[285] | 213 | |
---|
[1130] | 214 | nb_ice(:,1) = 1 ! default: there is no ice |
---|
| 215 | latice(:,1) = 1 |
---|
| 216 | lonice(:,1) = 1 |
---|
| 217 | nb_ice(:,2) = 0 |
---|
| 218 | latice(:,2) = 0 |
---|
| 219 | lonice(:,2) = 0 |
---|
| 220 | !print*,'jjm,iim',jjm,iim ! jjm = nb lati , iim = nb longi |
---|
[669] | 221 | |
---|
[1130] | 222 | ! loop over the GCM grid - except for poles (ig=1 and ngrid) |
---|
| 223 | do ig=2,klon_glo-1 |
---|
[520] | 224 | |
---|
[1130] | 225 | ! loop over the surface file grid |
---|
| 226 | do i=1,imd |
---|
| 227 | do j=1,jmd |
---|
| 228 | zelon = i - 180. |
---|
| 229 | zelat = 90. - j |
---|
[1528] | 230 | if ((abs(lati_glo(ig)*180./pi-zelat).le. |
---|
| 231 | & 90./real(nbp_lat-1)) .and. |
---|
| 232 | & (abs(long_glo(ig)*180./pi-zelon).le. |
---|
| 233 | & 180./real(nbp_lon))) then |
---|
[669] | 234 | ! count all points in that GCM grid point |
---|
| 235 | nb_ice(ig,1) = nb_ice(ig,1) + 1 |
---|
[712] | 236 | if (zdata(i,j) > min_icevalue) |
---|
[669] | 237 | ! count all detected points in that GCM grid point |
---|
| 238 | & nb_ice(ig,2) = nb_ice(ig,2) + 1 |
---|
[712] | 239 | endif |
---|
[1130] | 240 | enddo |
---|
| 241 | enddo |
---|
[712] | 242 | |
---|
[669] | 243 | ! projection of nb_ice on GCM lat and lon axes |
---|
[1528] | 244 | latice(1+(ig-2)/nbp_lon,:) = |
---|
| 245 | & latice(1+(ig-2)/nbp_lon,:) + nb_ice(ig,:) |
---|
| 246 | lonice(1+mod(ig-2,nbp_lon),:) = |
---|
| 247 | & lonice(1+mod(ig-2,nbp_lon),:) + nb_ice(ig,:) ! lonice is USELESS ... |
---|
[669] | 248 | |
---|
[1130] | 249 | enddo ! of do ig=2,klon_glo-1 |
---|
[669] | 250 | |
---|
| 251 | |
---|
| 252 | |
---|
[1130] | 253 | ! special case for poles |
---|
| 254 | nb_ice(1,2) = 1 ! ice prescribed on north pole |
---|
| 255 | latice(1,:) = nb_ice(1,:) |
---|
| 256 | lonice(1,:) = nb_ice(1,:) |
---|
[1528] | 257 | latice(nbp_lat-1,:) = nb_ice(ngrid,:) |
---|
| 258 | lonice(nbp_lon,:) = nb_ice(ngrid,:) |
---|
[669] | 259 | |
---|
| 260 | |
---|
[712] | 261 | ! print*, 'latice TOT', latice(:,1) |
---|
| 262 | ! print*, 'latice FOUND', latice(:,2) |
---|
| 263 | ! print*, 'lonice TOT', lonice(:,1) |
---|
| 264 | ! print*, 'lonice FOUND', lonice(:,2) |
---|
[669] | 265 | |
---|
[712] | 266 | ! print*, 'lat ratio', int(real(latice(:,2))/real(latice(:,1))*iim) |
---|
| 267 | ! print*, 'lon ratio', int(real(lonice(:,2))/real(lonice(:,1))*jjm) |
---|
[669] | 268 | |
---|
[712] | 269 | ! print*,'' |
---|
| 270 | ! print*,'sum lat', sum(latice(:,1)), sum(lonice(:,1)) |
---|
| 271 | ! print*,'sum lon', sum(latice(:,2)), sum(lonice(:,2)) |
---|
[669] | 272 | |
---|
| 273 | |
---|
[1130] | 274 | ! loop over GCM latitudes. CONSIDER ONLY NORTHERN HEMISPHERE |
---|
[1528] | 275 | do i=1,(nbp_lat-1)/2 |
---|
[1130] | 276 | step = 1. ! threshold to add ice cap |
---|
| 277 | count = 0. ! number of ice GCM caps at this latitude |
---|
| 278 | ! ratiolat is the ratio of area covered by ice within this GCM latitude range |
---|
| 279 | ratiolat = real(latice(i,2))/real(latice(i,1)) |
---|
| 280 | !print*,'i',i,(i-1)*iim+2,i*iim+1 |
---|
[669] | 281 | |
---|
[1130] | 282 | ! put ice caps while there is not enough ice, |
---|
| 283 | ! as long as the threshold is above 20% |
---|
[1528] | 284 | do while ((count.le.ratiolat*nbp_lon).and.(step.ge.0.2)) |
---|
[1130] | 285 | count = 0. |
---|
| 286 | ! loop over GCM longitudes |
---|
[1528] | 287 | do j=1,nbp_lon |
---|
[669] | 288 | ! if the detected ice ratio in the GCM grid point |
---|
| 289 | ! is more than 'step', then add ice |
---|
[1528] | 290 | if (real(nb_ice((i-1)*nbp_lon+1+j,2)) |
---|
| 291 | & / real(nb_ice((i-1)*nbp_lon+1+j,1)) .ge. step) then |
---|
| 292 | watercaptag_glo((i-1)*nbp_lon+1+j) = .true. |
---|
[669] | 293 | count = count + 1 |
---|
| 294 | endif |
---|
[1528] | 295 | enddo ! of do j=1,nbp_lon |
---|
| 296 | !print*, 'step',step,count,ratiolat*nbp_lon |
---|
[1130] | 297 | step = step - 0.01 |
---|
| 298 | enddo ! of do while |
---|
[1528] | 299 | !print*, 'step',step,count,ratiolat*nbp_lon |
---|
[669] | 300 | |
---|
[1130] | 301 | enddo ! of do i=1,jjm/2 |
---|
[669] | 302 | |
---|
| 303 | |
---|
[1130] | 304 | ELSE IF (icelocationmode .eq. 2) THEN |
---|
[669] | 305 | |
---|
[1130] | 306 | print*,'Surfini: predefined ice caps' |
---|
[669] | 307 | |
---|
[1528] | 308 | if ((nbp_lon.eq.32).and.((nbp_lat-1).eq.24)) then ! 32x24 |
---|
[633] | 309 | |
---|
[669] | 310 | print*,'water ice caps distribution for 32x24 resolution' |
---|
[633] | 311 | longwatercaptag(1:9) = .true. ! central cap - core |
---|
| 312 | longwatercaptag(26:33) = .true. ! central cap |
---|
[669] | 313 | longwatercaptag(1:33) = .true. ! central cap |
---|
| 314 | longwatercaptag(56) = .true. ! central cap |
---|
| 315 | longwatercaptag(58) = .true. ! central cap |
---|
| 316 | longwatercaptag(60) = .true. ! central cap |
---|
| 317 | longwatercaptag(62) = .true. ! central cap |
---|
| 318 | longwatercaptag(64) = .true. ! central cap |
---|
| 319 | !--------------------- OUTLIERS ---------------------------- |
---|
[633] | 320 | |
---|
[1528] | 321 | else if ((nbp_lon.eq.64).and.((nbp_lat-1).eq.48)) then ! 64x48 |
---|
[633] | 322 | |
---|
[669] | 323 | print*,'water ice caps distribution for 64x48 resolution' |
---|
[633] | 324 | longwatercaptag(1:65) = .true. ! central cap - core |
---|
| 325 | longwatercaptag(75:85) = .true. ! central cap |
---|
| 326 | longwatercaptag(93:114) = .true. ! central cap |
---|
[669] | 327 | !--------------------- OUTLIERS ---------------------------- |
---|
| 328 | if (.true.) then |
---|
[633] | 329 | longwatercaptag(136) = .true. ! outlier, lat = 78.75 |
---|
| 330 | longwatercaptag(138) = .true. ! outlier, lat = 78.75 |
---|
| 331 | longwatercaptag(140) = .true. ! outlier, lat = 78.75 |
---|
| 332 | longwatercaptag(142) = .true. ! outlier, lat = 78.75 |
---|
| 333 | longwatercaptag(161) = .true. ! outlier, lat = 78.75 |
---|
| 334 | longwatercaptag(163) = .true. ! outlier, lat = 78.75 |
---|
| 335 | longwatercaptag(165) = .true. ! outlier, lat = 78.75 |
---|
| 336 | longwatercaptag(183) = .true. ! outlier, lat = 78.75 |
---|
| 337 | longwatercaptag(185) = .true. ! outlier, lat = 78.75 |
---|
| 338 | longwatercaptag(187) = .true. ! outlier, lat = 78.75 |
---|
| 339 | longwatercaptag(189) = .true. ! outlier, lat = 78.75 |
---|
| 340 | longwatercaptag(191) = .true. ! outlier, lat = 78.75 |
---|
| 341 | longwatercaptag(193) = .true. ! outlier, lat = 78.75 |
---|
| 342 | longwatercaptag(194) = .true. ! outlier, lat = 75 |
---|
| 343 | longwatercaptag(203) = .true. ! outlier, lat = 75 |
---|
| 344 | longwatercaptag(207) = .true. ! outlier, lat = 75 |
---|
| 345 | longwatercaptag(244) = .true. ! outlier, lat = 75 |
---|
| 346 | longwatercaptag(246) = .true. ! outlier, lat = 75 |
---|
| 347 | longwatercaptag(250) = .true. ! outlier, lat = 75 |
---|
| 348 | longwatercaptag(252) = .true. ! outlier, lat = 75 |
---|
| 349 | longwatercaptag(254) = .true. ! outlier, lat = 75 |
---|
[740] | 350 | longwatercaptag(256) = .true. ! outlier, lat = 75 |
---|
[669] | 351 | endif |
---|
| 352 | !-------------------------------------------------------------- |
---|
[633] | 353 | |
---|
[669] | 354 | |
---|
[520] | 355 | |
---|
[1130] | 356 | else if (klon_glo .ne. 1) then |
---|
[669] | 357 | |
---|
[1130] | 358 | print*,'No predefined ice location for this resolution :', |
---|
[1528] | 359 | & nbp_lon,nbp_lat-1 |
---|
[1130] | 360 | print*,'Please change icelocationmode in surfini.F' |
---|
| 361 | print*,'Or add some new definitions ...' |
---|
| 362 | call abort |
---|
[520] | 363 | |
---|
[1130] | 364 | endif |
---|
[669] | 365 | |
---|
[1130] | 366 | do ig=1,klon_glo |
---|
| 367 | if (longwatercaptag(ig)) watercaptag_glo(ig) = .true. |
---|
| 368 | enddo |
---|
[283] | 369 | |
---|
[633] | 370 | |
---|
[1130] | 371 | ELSE IF (icelocationmode .eq. 3) THEN |
---|
[669] | 372 | |
---|
[1130] | 373 | print*,'Surfini: ice caps defined by lat and lon values' |
---|
[520] | 374 | |
---|
[1130] | 375 | do ig=1,klon_glo |
---|
[669] | 376 | |
---|
| 377 | c-------- Towards olympia planitia water caps ----------- |
---|
| 378 | c-------------------------------------------------------- |
---|
[520] | 379 | |
---|
[1130] | 380 | if ( ( ( lati_glo(ig)*180./pi .ge. 77. ) .and. ! cap #2 |
---|
| 381 | . ( lati_glo(ig)*180./pi .le. 80. ) .and. |
---|
| 382 | . ( long_glo(ig)*180./pi .ge. 110. ) .and. |
---|
| 383 | . ( long_glo(ig)*180./pi .le. 181. ) ) |
---|
[520] | 384 | . .or. |
---|
[283] | 385 | |
---|
[1130] | 386 | . ( ( lati_glo(ig)*180./pi .ge. 75. ) .and. ! cap #4 (Korolev crater) |
---|
| 387 | . ( lati_glo(ig)*180./pi .le. 76. ) .and. |
---|
| 388 | . ( long_glo(ig)*180./pi .ge. 150. ) .and. |
---|
| 389 | . ( long_glo(ig)*180./pi .le. 168. ) ) |
---|
[520] | 390 | . .or. |
---|
[1130] | 391 | . ( ( lati_glo(ig)*180./pi .ge. 77 ) .and. ! cap #5 |
---|
| 392 | . ( lati_glo(ig)*180./pi .le. 80. ) .and. |
---|
| 393 | . ( long_glo(ig)*180./pi .ge. -150.) .and. |
---|
| 394 | . ( long_glo(ig)*180./pi .le. -110.) ) ) |
---|
[520] | 395 | . then |
---|
| 396 | |
---|
| 397 | if ((alternate .eq. 0)) then ! 1/2 en 64x48 sinon trop large en lat |
---|
[669] | 398 | ! watercaptag(ig)=.true. |
---|
[520] | 399 | alternate = 1 |
---|
[669] | 400 | else |
---|
[520] | 401 | alternate = 0 |
---|
[669] | 402 | endif !end if alternate = 0 |
---|
| 403 | |
---|
[1130] | 404 | endif |
---|
[633] | 405 | |
---|
[669] | 406 | c----------- Opposite olympia planitia water cap -------- |
---|
| 407 | c-------------------------------------------------------- |
---|
[520] | 408 | |
---|
[1130] | 409 | if ( ( ( lati_glo(ig)*180./pi .ge. 80 ) .and. |
---|
| 410 | . ( lati_glo(ig)*180./pi .le. 84 ) ) |
---|
[669] | 411 | . .and. |
---|
[1130] | 412 | . ( ( long_glo(ig)*180./pi .lt. -95. ) .or. !!! 32x24 |
---|
| 413 | . ( long_glo(ig)*180./pi .gt. 85. ) ) ) then !!! 32x24 |
---|
| 414 | ! . ( ( ( long_glo(ig)*180./pi .ge. -29. ) .and. !!! 64x48 |
---|
| 415 | ! . ( long_glo(ig)*180./pi .le. 90. ) ) .or. !!! 64x48 |
---|
| 416 | ! . ( ( long_glo(ig)*180./pi .ge. -77. ) .and. !!! 64x48 |
---|
| 417 | ! . ( long_glo(ig)*180./pi .le. -70. ) ) ) ) then !!! 64x48 |
---|
| 418 | ! watercaptag_glo(ig)=.true. |
---|
| 419 | endif |
---|
[520] | 420 | |
---|
| 421 | |
---|
[669] | 422 | c -------------------- Central cap ---------------------- |
---|
[283] | 423 | c-------------------------------------------------------- |
---|
| 424 | |
---|
[1130] | 425 | if (abs(lati_glo(ig)*180./pi).gt.80) |
---|
| 426 | . watercaptag_glo(ig)=.true. |
---|
[669] | 427 | |
---|
| 428 | c-------------------------------------------------------- |
---|
| 429 | c-------------------------------------------------------- |
---|
[1130] | 430 | end do ! of (klon_glo) |
---|
[669] | 431 | |
---|
| 432 | |
---|
[1130] | 433 | ELSE |
---|
[669] | 434 | |
---|
| 435 | print*, 'In surfini.F, icelocationmode is ', icelocationmode |
---|
| 436 | print*, 'It should be 1, 2 or 3.' |
---|
| 437 | call abort |
---|
| 438 | |
---|
[1130] | 439 | ENDIF ! of if (icelocation) |
---|
[669] | 440 | |
---|
| 441 | |
---|
| 442 | ! print caps locations - useful for plots too |
---|
[1130] | 443 | print*,'surfini: latitude | longitude | ig' |
---|
| 444 | do ig=1,klon_glo |
---|
| 445 | dryness_glo(ig) = icedryness |
---|
[669] | 446 | |
---|
[1130] | 447 | if (watercaptag_glo(ig)) then |
---|
| 448 | print*,'surfini: ice water cap', lati_glo(ig)*180./pi, |
---|
| 449 | & long_glo(ig)*180./pi, ig |
---|
[669] | 450 | endif |
---|
| 451 | enddo |
---|
| 452 | |
---|
[1130] | 453 | endif !of if (is_master) |
---|
| 454 | |
---|
| 455 | ! Now scatter fields watercaptag and dryness from master to all |
---|
| 456 | ! (is just a plain copy in serial mode) |
---|
| 457 | call scatter(dryness_glo,dryness) |
---|
| 458 | call scatter(watercaptag_glo,watercaptag) |
---|
| 459 | |
---|
| 460 | ! end of #else of #ifdef MESOSCALE |
---|
[520] | 461 | ENDIF ! (caps & water) |
---|
[1212] | 462 | #endif |
---|
[520] | 463 | |
---|
[283] | 464 | c =============================================================== |
---|
| 465 | c INITIAL ALBEDO |
---|
| 466 | c =============================================================== |
---|
| 467 | |
---|
| 468 | write(*,*)"surfini: water frost thickness", |
---|
| 469 | s frost_albedo_threshold |
---|
| 470 | write(*,*)"surfini: water ice albedo:", albedo_h2o_ice |
---|
| 471 | write(*,*)"surfini: water ice TI:", inert_h2o_ice |
---|
| 472 | |
---|
| 473 | c To start with : Initial albedo = observed dataset |
---|
| 474 | c ------------------------------------------------- |
---|
| 475 | DO ig=1,ngrid |
---|
| 476 | psolaralb(ig,1)=albedodat(ig) |
---|
| 477 | psolaralb(ig,2)=albedodat(ig) |
---|
| 478 | END DO |
---|
[1130] | 479 | PRINT*,'surfini: minimum albedo without water caps', |
---|
| 480 | & minval(albedodat) |
---|
| 481 | PRINT*,'surfini: maximum albedo without water caps', |
---|
| 482 | & maxval(albedodat) |
---|
[38] | 483 | |
---|
[283] | 484 | c initial albedo if permanent H2O ice is present |
---|
| 485 | c ------------------------------------------------ |
---|
| 486 | IF ((water) .and. (caps)) THEN |
---|
| 487 | DO ig=1,ngrid |
---|
| 488 | IF (watercaptag(ig)) THEN |
---|
| 489 | psolaralb(ig,1) = albedo_h2o_ice |
---|
| 490 | psolaralb(ig,2) = albedo_h2o_ice |
---|
| 491 | ENDIF |
---|
| 492 | END DO |
---|
[1130] | 493 | PRINT*,'surfini: minimum albedo with water caps', |
---|
| 494 | & minval(albedodat) |
---|
| 495 | PRINT*,'surfini: maximum albedo with water caps', |
---|
| 496 | & maxval(albedodat) |
---|
[520] | 497 | |
---|
[283] | 498 | ENDIF |
---|
| 499 | |
---|
| 500 | c changing initial albedo if CO2 ice is present |
---|
| 501 | c ------------------------------------------- |
---|
| 502 | |
---|
| 503 | DO ig=1,ngrid |
---|
[38] | 504 | IF (piceco2(ig) .GT. 0.) THEN |
---|
[1541] | 505 | IF(latitude(ig).LT. 0.) THEN |
---|
[1130] | 506 | icap=2 ! Southern hemisphere |
---|
[38] | 507 | ELSE |
---|
[1130] | 508 | icap=1 ! Northern hemisphere |
---|
[38] | 509 | ENDIF |
---|
| 510 | psolaralb(ig,1) = albedice(icap) |
---|
[283] | 511 | psolaralb(ig,2) = albedice(icap) |
---|
[38] | 512 | END IF |
---|
[283] | 513 | END DO |
---|
[38] | 514 | |
---|
[283] | 515 | c changing initial albedo if water ice frost is present |
---|
| 516 | c ------------------------------------------- |
---|
| 517 | IF (water) THEN |
---|
| 518 | do iq=1,nqmx |
---|
| 519 | c if there is frost and surface albedo is set to albedo_h2o_ice |
---|
| 520 | if(noms(iq).eq."h2o_ice") then |
---|
| 521 | do ig=1,ngrid |
---|
[712] | 522 | |
---|
| 523 | if ((watercaptag(ig).eqv..false.) |
---|
| 524 | & .and. (qsurf(ig,iq).lt.-frost_albedo_threshold)) then |
---|
| 525 | print*, '' |
---|
| 526 | print*, '!!! PROBLEM in SURFINI !!!!' |
---|
| 527 | print*, 'FOUND NEGATIVE SURFACE ICE VALUE WHERE |
---|
| 528 | & WATERCAPTAG IS FALSE' |
---|
| 529 | print*, '' |
---|
| 530 | print*, 'ig,qsurf,threshold' , |
---|
| 531 | & ig, qsurf(ig,iq), -frost_albedo_threshold |
---|
| 532 | print*, '' |
---|
| 533 | print*, '1) Check h2o_ice in startfi and ice |
---|
| 534 | & distribution in surfini' |
---|
| 535 | print*, '2) Use ini_h2osurf option in newstart' |
---|
| 536 | print*, '' |
---|
[1041] | 537 | #ifndef MESOINI |
---|
[712] | 538 | CALL ABORT |
---|
[1041] | 539 | #else |
---|
| 540 | qsurf(ig,iq) = 0. |
---|
| 541 | #endif |
---|
[712] | 542 | endif |
---|
| 543 | |
---|
[283] | 544 | if ((piceco2(ig) .eq. 0.).and. |
---|
| 545 | & (qsurf(ig,iq).gt.frost_albedo_threshold)) then |
---|
| 546 | psolaralb(ig,1) = albedo_h2o_ice |
---|
| 547 | psolaralb(ig,2) = albedo_h2o_ice |
---|
| 548 | c PRINT*,'surfini.F frost', |
---|
[1541] | 549 | c & latitude(ig)*180./pi, longitude(ig)*180./pi |
---|
[283] | 550 | endif |
---|
| 551 | enddo |
---|
| 552 | endif |
---|
| 553 | end do |
---|
[1130] | 554 | PRINT*,'surfini: minimum albedo with frost and co2', |
---|
| 555 | & minval(albedodat) |
---|
| 556 | PRINT*,'surfini: maximum albedo with frost and co2', |
---|
| 557 | & maxval(albedodat) |
---|
[1087] | 558 | ELSE |
---|
| 559 | watercaptag(:) = .false. |
---|
[1130] | 560 | END IF ! OF IF(water) |
---|
[283] | 561 | |
---|
[38] | 562 | RETURN |
---|
| 563 | END |
---|