Changeset 3993
- Timestamp:
- Jan 5, 2026, 8:31:25 AM (7 days ago)
- File:
-
- 1 edited
-
trunk/LMDZ.VENUS/libf/phyvenus/dyn1d/rcm1d.F (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.VENUS/libf/phyvenus/dyn1d/rcm1d.F
r3877 r3993 1 1 PROGRAM rcm1d 2 2 3 USE infotrac 3 USE infotrac, only: infotrac_init, nqtot, tname 4 4 use control_mod, only: planet_type,day_step,cpofT 5 5 USE phys_state_var_mod … … 164 164 c Date (en sols depuis le solstice de printemps) du debut du run 165 165 day0 = 0 166 PRINT *,' date de depart?'166 PRINT *,'start date ?' 167 167 READ(unit,*) day0 168 168 day=REAL(day0) 169 169 PRINT *,day0 170 170 c Heure de demarrage 171 PRINT *,' heure de debut de simulation (entre0 et 24) ?'171 PRINT *,'starting hour of the simulation (between 0 et 24) ?' 172 172 READ(unit,*) time 173 173 time=time/24.E+0 … … 179 179 nlevel=nlayer+1 180 180 nsoil=nsoilmx 181 PRINT *,'n ombre de pas de temps par jour?'181 PRINT *,'nunmber of time steps per day ?' 182 182 READ(unit,*) day_step 183 183 print*,day_step … … 189 189 nbapp_rad = 24000 190 190 191 PRINT *,'n ombre de jours simules?'191 PRINT *,'number of days to run ?' 192 192 READ(unit,*) nb_days 193 193 print*,nb_days … … 201 201 c ------------------------------------ 202 202 c 203 PRINT *,' pression au sol'203 PRINT *,'surface pressure' 204 204 READ(unit,*) psurf 205 205 PRINT *,psurf … … 212 212 c latitude/longitude 213 213 c ------------------- 214 PRINT *,'latitude en degres ?'214 PRINT *,'latitude in degrees ?' 215 215 READ(unit,*) lati(1) 216 216 PRINT *,lati(1) … … 253 253 254 254 c vent geostrophique 255 PRINT *,' composante vers l est du vent geostrophique(U) ?'255 PRINT *,'eastward component of the geostrophic wind (U) ?' 256 256 READ(unit,*) gru 257 PRINT *,' composante vers le nord du vent geostrophique(V) ?'257 PRINT *,'northward component of the geostrophic wind (V) ?' 258 258 READ(unit,*) grv 259 259 … … 313 313 CLOSE(unit) 314 314 315 print*," Press ionAltitude Temperature"315 print*," Pressure Altitude Temperature" 316 316 ilayer=1 317 317 ftsol(1)=tmp2(0) … … 349 349 inquire(file="init_1D.txt",exist=file_is_present) 350 350 if (file_is_present) then 351 open(21, form = 'formatted', file = 'init_1D.txt') 352 read(21,*) 353 do ilayer = nlayer,1,-1 354 read(21,*) idummy, dummy, dummy, (q(ilayer,iq), iq = 1,nqtot) 355 ! print*, idummy, q(ilayer,1), q(ilayer,nqtot) 356 end do 357 close(21) 351 call read_init_1D(nlayer,nqtot,tname,q) 358 352 else 359 353 write(*,*) "Cannot find input file init_1D.txt!" … … 541 535 ENDDO 542 536 537 CONTAINS 538 539 SUBROUTINE read_init_1D(nlayer,nqtot,tname,q) 540 IMPLICIT NONE 541 542 integer,intent(in) :: nlayer 543 integer,intent(in) :: nqtot 544 character(len=*),intent(in) :: tname(nqtot) 545 real,intent(out) :: q(nlayer,nqtot) 546 547 character(len=512) :: line ! to store a line of text 548 character(len=22) :: words(nqtot+2) ! to store items in line of text 549 integer :: words_b(nqtot+2),words_e(nqtot+2) 550 logical :: new_word 551 integer :: iq(nqtot) ! tracer index 552 real :: lineq(nqtot+2) ! values in a line of file 553 integer :: idummy 554 integer :: i,j,ind 555 556 !1. Open file and process first line 557 open(21,form='formatted',file='init_1D.txt') 558 read(21,'(a)') line 559 560 ! identify words in line 561 ind=0 562 do i=1,len_trim(line) 563 if (line(i:i) == ' ') then 564 new_word=.true. 565 else 566 if (new_word) then 567 ind=ind+1 568 words_b(ind)=i 569 new_word=.false. 570 endif 571 words_e(ind)=i 572 endif 573 enddo ! of do i=1,len_trim(line) 574 ! write(*,*) "found ",ind," words" 575 do j=1,ind 576 write(words(j),"(a)") line(words_b(j):words_e(j)) 577 enddo 578 579 ! identify tracer index (if present in file) 580 iq(:)=0 581 do i=1,nqtot 582 do j=1,ind 583 ! look for match 584 if (trim(tname(i))==words(j)) then 585 iq(i)=j 586 exit ! move on to next tracer 587 endif 588 enddo 589 ! write(*,*) "i=",i,"iq(i)=",iq(i) 590 enddo 591 592 ! 2. Read following lines and assign tracer mixing ratios 593 do ilayer=nlayer,1,-1 594 read(21,*) idummy,(lineq(j),j=1,ind) 595 ! reorder/store values 596 do i=1,nqtot 597 if (iq(i)/=0) then 598 q(ilayer,i)=lineq(iq(i)) 599 else 600 ! set tracer value to zero since it is not in the file 601 q(ilayer,i)=0 602 endif 603 enddo 604 enddo ! of do lay=nlayer,1,-1 605 606 ! 3. close file 607 close(21) 608 609 END SUBROUTINE read_init_1D 610 543 611 c ======================================================== 544 END 545 546 c*********************************************************************** 547 c*********************************************************************** 548 549 !#include "../dyn3d_common/disvert_noterre.F" 550 !#include "../dyn3d/abort_gcm.F" 551 612 END PROGRAM rcm1d
Note: See TracChangeset
for help on using the changeset viewer.
