- Timestamp:
- Sep 21, 2023, 10:19:40 AM (14 months ago)
- Location:
- trunk/LMDZ.MARS
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.MARS/changelog.txt
r3042 r3045 4197 4197 == 13/09/2023 == JBC 4198 4198 The date and time are redefined at the end of PEM to write the file "restarfi_evol.nc". Like so, the next GCM runs can restart at the date and time given at the beginning of the simulation since the PEM is only progressing by step of one Martian year. 4199 4200 == 21/09/2023 == JBC 4201 Addition of the pressure profile to be able to run chained simulations in 1D. Like this, the surface pressure can be got from one run to the next. 4202 Rework of "write_profile.F90" + correction of arguments in its call in "testphys1d.F": 'qsurf' was wrongly given! -
trunk/LMDZ.MARS/libf/phymars/dyn1d/testphys1d.F
r3042 r3045 215 215 c Prescribed constants to be set here 216 216 c ------------------------------------------------------ 217 218 217 c if(.not. startfile_1D ) then 219 220 218 pi=2.E+0*asin(1.E+0) 221 219 … … 261 259 c ---------------------------------------------------- 262 260 cell_area(1)=1.E+0 263 264 261 265 262 ! check if there is a 'traceur.def' file … … 354 351 WRITE(*,*) 'nqfils=',nqfils 355 352 356 ! initialize tracers here:353 ! Initialize tracers here: 357 354 write(*,*) "testphys1d: initializing tracers" 358 call read_profile(nq, nlayer, qsurf,q)355 call read_profile(nq,nlayer,qsurf,q) 359 356 360 357 call init_physics_distribution(regular_lonlat,4, … … 398 395 c Discretization (Definition of grid and time steps) 399 396 c -------------- 400 c401 397 nlevel=nlayer+1 402 398 nsoil=nsoilmx 403 399 404 400 day_step=48 ! default value for day_step 405 PRINT *,'Number of time steps per sol ?'401 write(*,*)'Number of time steps per sol ?' 406 402 call getin("day_step",day_step) 407 403 write(*,*) " day_step = ",day_step … … 410 406 411 407 ndt=10 ! default value for ndt 412 PRINT *,'Number of sols to run ?'408 write(*,*)'Number of sols to run ?' 413 409 call getin("ndt",ndt) 414 410 write(*,*) " ndt = ",ndt … … 420 416 c Imposed surface pressure 421 417 c ------------------------------------ 422 c 423 424 psurf=610. ! default value for psurf 425 PRINT *,'Surface pressure (Pa) ?' 426 call getin("psurf",psurf) 427 write(*,*) " psurf = ",psurf 418 psurf = 610. ! Default value for psurf 419 write(*,*) 'Surface pressure (Pa)?' 420 open(3,file = 'profile_pressure',status = 'old', 421 & form = 'formatted',iostat = ierr) 422 if (ierr == 0) then 423 write(*,*) 'Reading file ''profile_pressure''...' 424 read(3,*) psurf 425 write(*,*) " psurf = ",psurf 426 else 427 write(*,*) 'File ''profile_pressure'' not found!' 428 write(*,*) 'Reading surface pressure in ''callphys.def''', 429 &' if given...' 430 call getin("psurf",psurf) 431 write(*,*) " psurf = ",psurf 432 endif 433 close(3) 428 434 429 435 c Reference pressures … … 440 446 c Orbital parameters 441 447 c ------------------ 442 443 448 if(.not. startfile_1D ) then 444 449 … … 449 454 write(*,*) "Orbital parameters from callphys.def" 450 455 write(*,*) "Enter eccentricity & Lsperi" 451 print *,'Martian eccentricity (0<e<1) ?'456 write(*,*) 'Martian eccentricity (0<e<1) ?' 452 457 call getin('excentric ',excentric) 453 458 write(*,*)"excentric =",excentric 454 print *,'Solar longitude of perihelion (0<Ls<360) ?'459 write(*,*) 'Solar longitude of perihelion (0<Ls<360) ?' 455 460 call getin('Lsperi',Lsperi ) 456 461 write(*,*)"Lsperi=",Lsperi … … 467 472 write(*,*) "Default present-day orbital parameters" 468 473 write(*,*) "Unless specified otherwise" 469 print *,'Min. distance Sun-Mars (Mkm)?'474 write(*,*)'Min. distance Sun-Mars (Mkm)?' 470 475 call getin("periheli",periheli) 471 476 write(*,*) " periheli = ",periheli 472 477 473 print *,'Max. distance Sun-Mars (Mkm)?'478 write(*,*)'Max. distance Sun-Mars (Mkm)?' 474 479 call getin("aphelie",aphelie) 475 480 write(*,*) " aphelie = ",aphelie 476 481 477 print *,'Day of perihelion?'482 write(*,*)'Day of perihelion?' 478 483 call getin("periday",peri_day) 479 484 write(*,*) " periday = ",peri_day 480 485 481 print *,'Obliquity?'486 write(*,*)'Obliquity?' 482 487 call getin("obliquit",obliquit) 483 488 write(*,*) " obliquit = ",obliquit … … 489 494 c ------------------ 490 495 latitude(1)=0 ! default value for latitude 491 PRINT *,'latitude (in degrees) ?'496 write(*,*)'latitude (in degrees) ?' 492 497 call getin("latitude",latitude(1)) 493 498 write(*,*) " latitude = ",latitude … … 533 538 534 539 albedodat(1)=0.2 ! default value for albedodat 535 PRINT *,'Albedo of bare ground ?'540 write(*,*)'Albedo of bare ground ?' 536 541 call getin("albedo",albedodat(1)) 537 542 write(*,*) " albedo = ",albedodat(1) … … 539 544 540 545 inertiedat(1,1)=400 ! default value for inertiedat 541 PRINT *,'Soil thermal inertia (SI) ?'546 write(*,*)'Soil thermal inertia (SI) ?' 542 547 call getin("inertia",inertiedat(1,1)) 543 548 write(*,*) " inertia = ",inertiedat(1,1) … … 581 586 c 582 587 hmons(1)=0.E+0 583 PRINT *,'hmons is initialized to ',hmons(1)588 write(*,*)'hmons is initialized to ',hmons(1) 584 589 summit(1)=0.E+0 585 PRINT *,'summit is initialized to ',summit(1)590 write(*,*)'summit is initialized to ',summit(1) 586 591 base(1)=0.E+0 587 592 c … … 604 609 c geostrophic wind 605 610 gru=10. ! default value for gru 606 PRINT *,'zonal eastward component of the geostrophic wind (m/s) ?' 611 write(*,*)'zonal eastward component of the geostrophic', 612 &' wind (m/s) ?' 607 613 call getin("u",gru) 608 614 write(*,*) " u = ",gru 609 615 grv=0. !default value for grv 610 PRINT *,'meridional northward component of the geostrophic',616 write(*,*)'meridional northward component of the geostrophic', 611 617 &' wind (m/s) ?' 612 618 call getin("v",grv) … … 641 647 if(.not. startfile_1D ) then 642 648 qsurf(igcm_co2)=0.E+0 ! default value for co2ice 643 PRINT *,'Initial CO2 ice on the surface (kg.m-2)'649 write(*,*)'Initial CO2 ice on the surface (kg.m-2)' 644 650 call getin("co2ice",qsurf(igcm_co2)) 645 651 write(*,*) " co2ice = ",qsurf(igcm_co2) … … 664 670 c """""""""""""""""""" 665 671 hybrid=.true. 666 PRINT *,'Hybrid coordinates ?'672 write(*,*)'Hybrid coordinates ?' 667 673 call getin("hybrid",hybrid) 668 674 write(*,*) " hybrid = ", hybrid … … 807 813 endif !(.not. startfile_1D ) 808 814 watercaptag(1)=.false. ! Default: no water ice reservoir 809 print *,'Water ice cap on ground ?'815 write(*,*)'Water ice cap on ground ?' 810 816 call getin("watercaptag",watercaptag) 811 817 write(*,*) " watercaptag = ",watercaptag … … 816 822 atm_wat_profile = -1. ! Default: free atm wat profile 817 823 if (water) then 818 print *,'Force atmospheric water vapor profile?'824 write(*,*)'Force atmospheric water vapor profile?' 819 825 call getin("atm_wat_profile",atm_wat_profile) 820 826 write(*,*) "atm_wat_profile = ", atm_wat_profile … … 993 999 ENDDO ! of idt=1,ndt ! end of time stepping loop 994 1000 995 ! update the profilesfiles at the end of the run996 write_prof =.false.1001 ! Update the profile files at the end of the run 1002 write_prof = .false. 997 1003 call getin("write_prof",write_prof) 998 IF (write_prof) then 999 DO iq = 1,nq 1000 call writeprofile(nlayer,q(:,iq),noms(iq),qsurf) 1001 ENDDO 1002 ENDIF 1004 if (write_prof) then 1005 do iq = 1,nq 1006 call writeprofile(nlayer,noms(iq),qsurf(iq),q(:,iq)) 1007 enddo 1008 call writeprofile(nlayer,'pressure',psurf,play) 1009 endif 1003 1010 1004 1011 write(*,*) "testphys1d: Everything is cool." -
trunk/LMDZ.MARS/libf/phymars/dyn1d/write_profile.F90
r3000 r3045 1 SUBROUTINE writeprofile(nlev, data,name2,qsurf)1 SUBROUTINE writeprofile(nlev,profilename,surfdata,profiledata) 2 2 3 implicit none 3 4 4 IMPLICIT NONE 5 ! arguments 6 integer, intent(in) :: nlev 7 real, intent(in) :: surfdata 8 real, dimension(nlev), intent(in) :: profiledata 9 character(len = 30), intent(in) :: profilename 5 10 6 ! arguments: 7 INTEGER nlev 8 REAL data(nlev) 9 REAL qsurf 10 CHARACTER(len=30) :: name2 11 ! Local 12 integer :: il 11 13 12 !local 13 INTEGER il 14 ! Write the data 15 open(1,file = 'profile_out_'//trim(profilename),form = 'formatted') 16 write(1,*) surfdata 17 do il = 1,nlev 18 write(1,*) profiledata(il) 19 enddo 20 close(1) 21 return 14 22 15 !write the data16 OPEN(1,file='profile_out_'//trim(name2),form='formatted')17 write(1,*) qsurf18 DO il=1,nlev19 write(1,*) data(il)20 ENDDO21 CLOSE(1)22 RETURN23 23 END
Note: See TracChangeset
for help on using the changeset viewer.