Changeset 3004
- Timestamp:
- Jul 21, 2023, 7:26:15 AM (16 months ago)
- Location:
- trunk/LMDZ.MARS
- Files:
-
- 2 deleted
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.MARS/changelog.txt
r3001 r3004 4106 4106 Some adaptations to make the 1D model run with XIOS and MPICH for use with 1D PEM. 4107 4107 Small fixes to compile and run 1D model related to the second to last commit. 4108 4109 == 21/07/2023 == EM 4110 Some code cleanup. Remove obsolete "comg1d.h" and "writeg1d.F" (were used to 4111 specifically output for Grads in 1D). 4112 Also turned lwi and lwflux into modules while at it. -
trunk/LMDZ.MARS/libf/phymars/dyn1d/testphys1d.F
r3003 r3004 81 81 !#include "control.h" 82 82 include "netcdf.inc" 83 include "comg1d.h"84 83 !#include "advtrac.h" 85 84 … … 829 828 endif 830 829 831 832 c Initialization for GRADS outputs in "g1d.dat" and "g1d.ctl"833 c ----------------------------------------------------------------834 c (output done in "writeg1d", typically called by "physiq.F")835 836 g1d_nlayer=nlayer837 g1d_nomfich='g1d.dat'838 g1d_unitfich=40839 g1d_nomctl='g1d.ctl'840 g1d_unitctl=41841 g1d_premier=.true.842 g2d_premier=.true.843 844 830 c Write a "startfi" file 845 831 c -------------------- … … 994 980 ENDIF 995 981 996 c ========================================================997 c OUTPUTS998 c ========================================================999 1000 c finalize and close grads files "g1d.dat" and "g1d.ctl"1001 1002 c CALL endg1d(1,nlayer,zphi/(g*1000.),ndt)1003 CALL endg1d(1,nlayer,zlay/1000.,ndt)1004 1005 982 write(*,*) "testphys1d: Everything is cool." 1006 983 -
trunk/LMDZ.MARS/libf/phymars/lwflux.F
r1917 r3004 1 subroutine lwflux (ig0,kdlon,kflev,dp 1 module lwflux_mod 2 3 implicit none 4 5 contains 6 7 subroutine lwflux (ig0,kdlon,kflev,dp 2 8 . ,bsurf,btop,blev,blay,dbsublay 3 9 . ,tlay, tlev, dt0 ! pour sortie dans g2d uniquement … … 16 22 17 23 include "callkeys.h" 18 include "comg1d.h"19 24 20 25 c---------------------------------------------------------------------- … … 347 352 end do 348 353 end do 349 END IF 350 351 c---------------------------------------------------------------------- 352 c 7.0 outputs Grads 2D 353 c ---------------- 354 355 c ig1d: point de la grille physique ou on veut faire la sortie 356 c ig0+1: point du decoupage de la grille physique 357 358 if (callg2d) then 359 360 ig1d = kdlon/2 + 1 361 c ig1d = kdlon 362 363 if ((ig0+1).LE.ig1d .and. ig1d.LE.(ig0+kdlon) 364 . .OR. kdlon.EQ.1 ) then 365 366 ig = ig1d-ig0 367 print*, 'Sortie g2d: ig1d, ig, ig0', ig1d, ig, ig0 368 369 c-------------------------------------------- 370 c Ouverture de g2d.dat 371 c-------------------------------------------- 372 if (g2d_premier) then 373 open (47,file='g2d.dat' 374 clmd & ,form='unformatted',access='direct',recl=4) 375 & ,form='unformatted',access='direct',recl=1 376 & ,status='unknown') 377 g2d_irec=0 378 g2d_appel=0 379 g2d_premier=.false. 380 endif 381 g2d_appel = g2d_appel+1 382 383 c-------------------------------------------- 384 c Sortie g2d des xi proches + distants 385 c-------------------------------------------- 386 cl if (nflev .NE. 500) then 387 do ja = 1,nuco2 388 do j = 0,nlaylte+1 389 do i = 0,nlaylte+1 390 g2d_irec=g2d_irec+1 391 reel4 = xi(ig1d,ja,i,j) 392 write(47,rec=g2d_irec) reel4 393 enddo 394 enddo 395 enddo 396 cl endif 397 398 c------------------------------------------------------ 399 c Writeg2d des ksidb 400 c------------------------------------------------------ 401 do ja = 1,nuco2 402 c ja=1 403 do j = 0,nlaylte+1 404 do i = 0,nlaylte+1 405 g2d_irec=g2d_irec+1 406 reel4 = ksidb(ig,ja,i,j) 407 write(47,rec=g2d_irec) reel4 408 enddo 409 enddo 410 enddo 411 412 do j = 0,nlaylte+1 413 do i = 0,nlaylte+1 414 g2d_irec=g2d_irec+1 415 reel4 = ksidb(ig,3,i,j) 416 write(47,rec=g2d_irec) reel4 417 enddo 418 enddo 419 420 c------------------------------------------------------ 421 c Writeg2d dpsgcp 422 c------------------------------------------------------ 423 424 do j = 1 , nlaylte 425 do i = 0 , nlaylte+1 426 dpsgcp(i,j) = dp(ig,j) / gcp 427 enddo 428 enddo 429 430 do i = 0 , nlaylte+1 431 c dpsgcp(i,0) = 0.0002 ! (rapport ~ entre 1000 et 10000 pour le sol) 432 dpsgcp(i,0) = 1. ! (pour regler l'echelle des sorties) 433 dpsgcp(i,nlaylte+1) = 0. 434 enddo 435 436 c print* 437 c print*,'gcp: ',gcp 438 c print* 439 c do i = 0 , nlaylte+1 440 c print*,i,'dp: ',dp(ig,i) 441 c enddo 442 c print* 443 c do i = 0 , nlaylte+1 444 c print*,i,'dpsgcp: ',dpsgcp(i,1) 445 c enddo 446 447 do j = 0,nlaylte+1 448 do i = 0,nlaylte+1 449 g2d_irec=g2d_irec+1 450 reel4 = dpsgcp(i,j) 451 write(47,rec=g2d_irec) reel4 452 enddo 453 enddo 454 455 c------------------------------------------------------ 456 c Writeg2d temperature 457 c------------------------------------------------------ 458 459 do j = 1 , nlaylte 460 do i = 0 , nlaylte+1 461 temp(i,j) = tlay(ig,j) 462 enddo 463 enddo 464 465 do i = 0 , nlaylte+1 466 temp(i,0) = tlev(ig,1)+dt0(ig) ! temperature surface 467 temp(i,nlaylte+1) = 0. ! temperature espace (=0) 468 enddo 469 470 do j = 0,nlaylte+1 471 do i = 0,nlaylte+1 472 g2d_irec=g2d_irec+1 473 reel4 = temp(i,j) 474 write(47,rec=g2d_irec) reel4 475 enddo 476 enddo 477 478 write(76,*) 'ig1d, ig, ig0', ig1d, ig, ig0 479 write(76,*) 'nlaylte', nlaylte 480 write(76,*) 'nflev', nflev 481 write(76,*) 'kdlon', kdlon 482 write(76,*) 'ndlo2', ndlo2 483 write(76,*) 'ndlon', ndlon 484 do ja=1,4 485 write(76,*) 'bsurf', ja, bsurf(ig,ja) 486 write(76,*) 'btop', ja, btop(ig,ja) 487 488 do j=1,nlaylte+1 489 write(76,*) 'blev', ja, j, blev(ig,ja,j) 490 enddo 491 492 do j=1,nlaylte 493 write(76,*) 'blay', ja, j, blay(ig,ja,j) 494 enddo 495 496 do j=1,2*nlaylte 497 write(76,*) 'dbsublay', ja, j, dbsublay(ig,ja,j) 498 enddo 499 enddo 500 501 endif 502 c************************************************************************ 503 endif ! callg2d 504 505 end 354 END IF ! of IF (computeflux) 355 356 end subroutine lwflux 357 358 end module lwflux_mod -
trunk/LMDZ.MARS/libf/phymars/lwi.F
r1524 r3004 1 module lwi_mod 2 3 implicit none 4 5 contains 6 1 7 subroutine lwi (ig0,kdlon,kflev 2 8 . ,psi,zdblay,pdp … … 10 16 implicit none 11 17 12 #include "comg1d.h" 13 #include "callkeys.h" 18 include "callkeys.h" 14 19 15 20 CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC … … 33 38 c 34 39 35 integer ig0,kdlon,kflev 36 37 real psi(ndlo2,kflev) 38 . , zdblay(ndlo2,nir,kflev) 39 . , pdp(ndlo2,kflev) 40 41 42 real newpcolc(ndlo2,kflev) 40 integer,intent(in) :: ig0 41 integer,intent(in) :: kdlon 42 integer,intent(in) :: kflev 43 44 real,intent(in) :: psi(ndlo2,kflev) 45 real,intent(in) :: zdblay(ndlo2,nir,kflev) 46 real,intent(in) :: pdp(ndlo2,kflev) 47 48 real,intent(out) :: newpcolc(ndlo2,kflev) 43 49 44 50 c------------------------------------------------------------------------- … … 215 221 216 222 c------------------------------------------------------------------------- 217 RETURN 218 END 223 224 end subroutine lwi 225 226 end module lwi_mod -
trunk/LMDZ.MARS/libf/phymars/lwmain_mod.F
r1983 r3004 21 21 use dimradmars_mod, only: naerkind 22 22 use yomlw_h, only: nlaylte, xi 23 use lwi_mod, only: lwi 24 use lwflux_mod, only: lwflux 25 23 26 implicit none 24 27 … … 26 29 c ------------- 27 30 include "callkeys.h" 28 include "comg1d.h"29 31 30 32 c---------------------------------------------------------------------- -
trunk/LMDZ.MARS/libf/phymars/physiq_mod.F
r3000 r3004 213 213 214 214 include "callkeys.h" 215 include "comg1d.h"216 215 include "nlteparams.h" 217 216 include "netcdf.inc"
Note: See TracChangeset
for help on using the changeset viewer.