Changeset 3974 for trunk/LMDZ.MARS/libf
- Timestamp:
- Nov 21, 2025, 4:28:06 PM (2 months ago)
- Location:
- trunk/LMDZ.MARS/libf/phymars
- Files:
-
- 4 edited
-
phyetat0_mod.F90 (modified) (1 diff)
-
physiq_mod.F (modified) (2 diffs)
-
planete_h.F90 (modified) (2 diffs)
-
tabfi.F (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.MARS/libf/phymars/phyetat0_mod.F90
r3964 r3974 35 35 use comcstfi_h, only: pi 36 36 use geometry_mod, only: latitude 37 use soil_settings_mod, only: soil_settings 38 use tabfi_mod, only: tabfi 39 use callkeys_mod, only: startphy_file, rdstorm, hdo 40 use callkeys_mod, only: CLFvarying, CLFfixval 37 use soil_settings_mod, only: soil_settings 38 use tabfi_mod, only: tabfi 39 use callkeys_mod, only: startphy_file, rdstorm, hdo, CLFvarying, CLFfixval 41 40 42 41 implicit none -
trunk/LMDZ.MARS/libf/phymars/physiq_mod.F
r3918 r3974 85 85 use turb_mod, only: q2, wstar, ustar, sensibFlux, 86 86 & zmax_th, hfmax_th, turb_resolved 87 use planete_h, only: aphelie, periheli, year_day, peri_day, 88 & obliquit 89 use planete_h, only: iniorbit 87 use planete_h, only: obliquit 90 88 use orbite_mod, only: orbite 91 89 USE comcstfi_h, only: r, cpp, mugaz, g, rcp, pi, rad … … 718 716 c ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 719 717 CALL surfini(ngrid,nslope,qsurf) 720 CALL iniorbit(aphelie,periheli,year_day,peri_day,obliquit) 718 721 719 c initialize soil 722 720 c ~~~~~~~~~~~~~~~ -
trunk/LMDZ.MARS/libf/phymars/planete_h.F90
r3095 r3974 1 1 MODULE planete_h 2 IMPLICIT NONE 2 3 implicit none 3 4 4 5 REAL,SAVE :: aphelie ! Aphelion, in Mkm … … 23 24 24 25 CONTAINS 26 !----------------------------------------------------------------------- 27 ! Gives sol at perihelion for ls at perihelion (for precession cycles) 28 SUBROUTINE lsp2solp(lsp,solp) 29 30 use comcstfi_h, only: pi 31 32 implicit none 33 34 ! Arguments: 35 real, intent(in) :: lsp ! ls at perihelion 36 real, intent(out) :: solp ! sol at perihelion 37 38 ! Locals: 39 real :: zx0 ! eccentric anomaly at Ls=0 40 real, parameter :: degrad = 180.d0/pi 41 42 ! Compute orbit geometrical parameters 43 e_elips = (aphelie - periheli)/(aphelie + periheli) 44 zx0 = -2.0*datan(dtan(0.5*lsp/degrad)*dsqrt((1. - e_elips)/(1. + e_elips))) 45 if (zx0 <= 0.) zx0 = zx0 + 2.*pi 46 47 ! Compute sol at perihelion 48 solp = year_day*(1. - (zx0 - e_elips*dsin(zx0))/(2.*pi)) 49 50 END SUBROUTINE lsp2solp 51 52 !----------------------------------------------------------------------- 53 ! Initialize orbital parameters 54 SUBROUTINE iniorbit() 55 56 use comcstfi_h, only: pi 57 58 implicit none 59 60 ! Locals: 61 character(8), parameter :: myname = "iniorbit" 62 real :: zxref, zanom, zz, zx0, zdx 63 integer :: iter 64 65 ! Info about orbital values 66 write(*,*)myname,': Aphelion in Mkm =',aphelie 67 write(*,*)myname,': Perihelion in Mkm =',periheli 68 write(*,*)myname,': Number of days in the year =',year_day 69 write(*,*)myname,': Date of perihelion in days =',peri_day 70 write(*,*)myname,': Obliquity in degrees =',obliquit 71 72 ! Compute orbit geometrical parameters 73 e_elips = (aphelie - periheli)/(aphelie + periheli) 74 p_elips = 0.5*(periheli + aphelie)*(1. - e_elips*e_elips)/unitastr 75 write(*,*)myname,': Orbit eccentricity =',e_elips 76 write(*,*)myname,': Ellipse semi-latus rectum =',p_elips 25 77 26 SUBROUTINE iniorbit(paphelie,pperiheli,pyear_day,pperi_day,pobliq) 27 use comcstfi_h, only: pi 28 IMPLICIT NONE 29 ! initialize orbital parameters 30 31 REAL,INTENT(IN) :: paphelie,pperiheli,pyear_day,pperi_day,pobliq 78 ! Compute mean anomaly zanom 79 zz = (year_day - peri_day)/year_day 80 zanom = 2.*pi*(zz - nint(zz)) 81 zxref = abs(zanom) 82 write(*,*)myname,': zanom =',zanom 32 83 33 CHARACTER(LEN=8),PARAMETER :: myname="iniorbit" 34 REAL :: zxref,zanom,zz,zx0,zdx 35 INTEGER :: iter 36 37 ! copy over input values 38 aphelie =paphelie 39 periheli=pperiheli 40 year_day=pyear_day 41 obliquit=pobliq 42 peri_day=pperi_day 43 44 write(*,*)myname,': Perihelion in Mkm ',periheli 45 write(*,*)myname,': Aphelion in Mkm ',aphelie 46 write(*,*)myname,': Obliquity in degrees :',obliquit 47 48 ! compute orbit geometrical parameters 49 e_elips=(aphelie-periheli)/(periheli+aphelie) 50 p_elips=0.5*(periheli+aphelie)*(1-e_elips*e_elips)/unitastr 51 52 write(*,*)myname,': e_elips',e_elips 53 write(*,*)myname,': p_elips',p_elips 54 55 ! compute mean anomaly zanom 56 57 zz=(year_day-pperi_day)/year_day 58 zanom=2.*pi*(zz-nint(zz)) 59 zxref=abs(zanom) 60 write(*,*)myname,': zanom ',zanom 61 62 ! solve equation zx0 - e * sin (zx0) = zxref for eccentric anomaly zx0 84 ! Solve equation zx0 - e * sin (zx0) = zxref for eccentric anomaly zx0 63 85 ! using Newton method 64 86 65 zx0 =zxref+e_elips*sin(zxref)66 DO iter =1,10067 zdx =-(zx0-e_elips*sin(zx0)-zxref)/(1.-e_elips*cos(zx0))68 if (abs(zdx).le.(1.e-12)) exit69 zx0 =zx0+zdx87 zx0 = zxref + e_elips*sin(zxref) 88 DO iter = 1,100 89 zdx = -(zx0 - e_elips*sin(zx0) - zxref)/(1. - e_elips*cos(zx0)) 90 if (abs(zdx).le.(1.e-12)) exit 91 zx0 = zx0 + zdx 70 92 ENDDO 71 93 72 zx0 =zx0+zdx73 if (zanom.lt.0.) zx0=-zx074 write(*,*)myname,': zx0',zx094 zx0 = zx0 + zdx 95 if (zanom < 0.) zx0 = -zx0 96 write(*,*)myname,': Eccentric anomaly zx0 =',zx0 75 97 76 lsperi =-2.*atan(sqrt((1.+e_elips)/(1.-e_elips))*tan(zx0/2.))98 lsperi = -2.*atan(sqrt((1. + e_elips)/(1. - e_elips))*tan(zx0/2.)) 77 99 lsperi = modulo(lsperi,2.*pi) 78 write(*,*)myname,': Perihelion solar long. Ls (deg)=', & 79 lsperi*180./pi 100 write(*,*)myname,': Perihelion solar long. Ls (deg) =', lsperi*180./pi 80 101 81 102 END SUBROUTINE iniorbit -
trunk/LMDZ.MARS/libf/phymars/tabfi.F
r3902 r3974 61 61 use time_phylmdz_mod, only: daysec, dtphys 62 62 use planete_h, only: aphelie, emin_turb, lmixmin, obliquit, 63 & peri_day, periheli, year_day 63 & peri_day, periheli, year_day, 64 & lsp2solp, iniorbit 65 64 66 implicit none 65 67 … … 460 462 write(*,*) 'perihelion =',periheli 461 463 write(*,*) 'and',year_day,'sols/year' 462 call lsp2solp(peri_ls,peri_day ,aphelie,periheli,year_day)464 call lsp2solp(peri_ls,peri_day) 463 465 write(*,*) 'peri_day (new value):',peri_day 464 466 … … 543 545 544 546 c----------------------------------------------------------------------- 547 c Initialization of orbital parameters 548 c----------------------------------------------------------------------- 549 call iniorbit() 550 551 c----------------------------------------------------------------------- 545 552 c Case when using a start file from before March 1996 (without iceradius... 546 553 c----------------------------------------------------------------------- … … 555 562 end if 556 563 557 c-----------------------------------------------------------------------558 564 END SUBROUTINE tabfi 559 565 560 561 562 563 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!564 ! gives sol at perihelion for ls at perihelion (for precession cycles)565 subroutine lsp2solp(lsp,solp,aphelie,periheli,year_day)566 567 implicit none568 ! Arguments:569 real lsp ! Input: ls at perihelion570 real solp ! Output: sol at perihelion571 real aphelie,periheli,year_day ! Input: parameters572 573 ! Local:574 double precision zx0 ! eccentric anomaly at Ls=0575 double precision e_elips576 double precision pi,degrad577 578 parameter (pi=4.d0*atan(1.d0))579 parameter (degrad=180.d0/pi)580 581 e_elips=(aphelie-periheli)/(aphelie+periheli)582 zx0 = -2.0*datan(dtan(0.5*lsp/degrad)583 . *dsqrt((1.-e_elips)/(1.+e_elips)))584 if (zx0 .le. 0.) zx0 = zx0 + 2.*pi585 586 solp = year_day*(1.-(zx0-e_elips*dsin(zx0))/(2.*pi))587 588 589 end subroutine lsp2solp590 591 592 566 END MODULE tabfi_mod 593
Note: See TracChangeset
for help on using the changeset viewer.
