Changeset 1403 for LMDZ4/trunk/libf/dyn3dpar/leapfrog_p.F
- Timestamp:
- Jul 1, 2010, 11:02:53 AM (14 years ago)
- Location:
- LMDZ4/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ4/trunk
- Property svn:mergeinfo changed
-
LMDZ4/trunk/libf/dyn3dpar/leapfrog_p.F
r1286 r1403 20 20 USE guide_p_mod, ONLY : guide_main 21 21 USE getparam 22 USE control_mod 22 23 23 24 IMPLICIT NONE … … 62 63 #include "logic.h" 63 64 #include "temps.h" 64 #include "control.h"65 65 #include "ener.h" 66 66 #include "description.h" 67 67 #include "serre.h" 68 #include "com_io_dyn.h"68 !#include "com_io_dyn.h" 69 69 #include "iniprint.h" 70 70 #include "academic.h" … … 212 212 itau = 0 213 213 ! iday = day_ini+itau/day_step 214 ! time = FLOAT(itau-(iday-day_ini)*day_step)/day_step+time_0214 ! time = REAL(itau-(iday-day_ini)*day_step)/day_step+time_0 215 215 ! IF(time.GT.1.) THEN 216 216 ! time = time-1. … … 352 352 c idissip=1 353 353 IF( purmats ) THEN 354 ! Purely Matsuno time stepping 354 355 IF( MOD(itau,iconser) .EQ.0.AND. forward ) conser = .TRUE. 355 356 IF( MOD(itau,idissip ).EQ.0.AND..NOT.forward ) apdiss = .TRUE. … … 357 358 s .and. iflag_phys.EQ.1 ) apphys = .TRUE. 358 359 ELSE 360 ! Leapfrog/Matsuno time stepping 359 361 IF( MOD(itau ,iconser) .EQ. 0 ) conser = .TRUE. 360 362 IF( MOD(itau+1,idissip) .EQ. 0 ) apdiss = .TRUE. … … 362 364 END IF 363 365 366 ! Ehouarn: for Shallow Water case (ie: 1 vertical layer), 367 ! supress dissipation step 368 if (llm.eq.1) then 369 apdiss=.false. 370 endif 371 364 372 cym ---> Pour le moment 365 373 cym apphys = .FALSE. 366 374 statcl = .FALSE. 367 conser = .FALSE. 375 conser = .FALSE. ! ie: no output of control variables to stdout in // 368 376 369 377 if (firstCaldyn) then … … 677 685 call suspend_timer(timer_caldyn) 678 686 687 if (prt_level >= 10) then 679 688 write(lunout,*) 680 689 & 'leapfrog_p: Entree dans la physique : Iteration No ',true_itau 690 endif 681 691 c$OMP END MASTER 682 692 … … 964 974 ijb=ij_begin 965 975 ije=ij_end 966 teta(ijb:ije,:)=teta(ijb:ije,:) 967 s -iphysiq*dtvr*(teta(ijb:ije,:)-tetarappel(ijb:ije,:))/taurappel 976 !$OMP DO SCHEDULE(STATIC,OMP_CHUNK) 977 do l=1,llm 978 teta(ijb:ije,l)=teta(ijb:ije,l) 979 & -iphysiq*dtvr*(teta(ijb:ije,l)-tetarappel(ijb:ije,l))/taurappel 980 enddo 981 !$OMP END DO 968 982 969 983 call Register_Hallo(ucov,ip1jmp1,llm,0,1,1,0,Request_Physic) … … 972 986 c$OMP BARRIER 973 987 call WaitRequest(Request_Physic) 974 988 c$OMP BARRIER 989 !$OMP MASTER 975 990 call friction_p(ucov,vcov,iphysiq*dtvr) 991 !$OMP END MASTER 992 !$OMP BARRIER 976 993 ENDIF ! of IF(iflag_phys.EQ.2) 977 994 … … 1089 1106 enddo 1090 1107 c$OMP END DO NOWAIT 1091 endif 1108 endif ! of if (dissip_conservative) 1092 1109 1093 1110 ijb=ij_begin … … 1198 1215 c$OMP END MASTER 1199 1216 c$OMP BARRIER 1200 END IF 1217 END IF ! of IF(apdiss) 1201 1218 1202 1219 cc$OMP END PARALLEL … … 1280 1297 itau= itau + 1 1281 1298 ! iday= day_ini+itau/day_step 1282 ! time= FLOAT(itau-(iday-day_ini)*day_step)/day_step+time_01299 ! time= REAL(itau-(iday-day_ini)*day_step)/day_step+time_0 1283 1300 ! IF(time.GT.1.) THEN 1284 1301 ! time = time-1. … … 1337 1354 ENDIF !ok_dynzon 1338 1355 #endif 1339 ENDIF 1356 IF (ok_dyn_ave) THEN 1357 !$OMP MASTER 1358 #ifdef CPP_IOIPSL 1359 ! Ehouarn: Gather fields and make master send to output 1360 call Gather_Field(vcov,ip1jm,llm,0) 1361 call Gather_Field(ucov,ip1jmp1,llm,0) 1362 call Gather_Field(teta,ip1jmp1,llm,0) 1363 call Gather_Field(pk,ip1jmp1,llm,0) 1364 call Gather_Field(phi,ip1jmp1,llm,0) 1365 do iq=1,nqtot 1366 call Gather_Field(q(1,1,iq),ip1jmp1,llm,0) 1367 enddo 1368 call Gather_Field(masse,ip1jmp1,llm,0) 1369 call Gather_Field(ps,ip1jmp1,1,0) 1370 call Gather_Field(phis,ip1jmp1,1,0) 1371 if (mpi_rank==0) then 1372 CALL writedynav(itau,vcov, 1373 & ucov,teta,pk,phi,q,masse,ps,phis) 1374 endif 1375 #endif 1376 !$OMP END MASTER 1377 ENDIF ! of IF (ok_dyn_ave) 1378 ENDIF ! of IF((MOD(itau,iperiod).EQ.0).OR.(itau.EQ.itaufin)) 1340 1379 1341 1380 c----------------------------------------------------------------------- … … 1343 1382 c ------------------------------ 1344 1383 1345 c IF( MOD(itau,iecri).EQ.0) THEN1346 1347 IF( MOD(itau,iecri*day_step).EQ.0) THEN 1384 IF( MOD(itau,iecri).EQ.0) THEN 1385 ! Ehouarn: output only during LF or Backward Matsuno 1386 if (leapf.or.(.not.leapf.and.(.not.forward))) then 1348 1387 c$OMP BARRIER 1349 1388 c$OMP MASTER … … 1379 1418 1380 1419 #ifdef CPP_IOIPSL 1381 1420 if (ok_dyn_ins) then 1421 ! Ehouarn: Gather fields and make master write to output 1422 call Gather_Field(vcov,ip1jm,llm,0) 1423 call Gather_Field(ucov,ip1jmp1,llm,0) 1424 call Gather_Field(teta,ip1jmp1,llm,0) 1425 call Gather_Field(phi,ip1jmp1,llm,0) 1426 do iq=1,nqtot 1427 call Gather_Field(q(1,1,iq),ip1jmp1,llm,0) 1428 enddo 1429 call Gather_Field(masse,ip1jmp1,llm,0) 1430 call Gather_Field(ps,ip1jmp1,1,0) 1431 call Gather_Field(phis,ip1jmp1,1,0) 1432 if (mpi_rank==0) then 1433 CALL writehist(itau,vcov,ucov,teta,phi,q,masse,ps,phis) 1434 endif 1382 1435 ! CALL writehist_p(histid,histvid, itau,vcov, 1383 1436 ! & ucov,teta,phi,q,masse,ps,phis) 1384 1437 ! or use writefield_p 1438 ! call WriteField_p('ucov',reshape(ucov,(/iip1,jmp1,llm/))) 1439 ! call WriteField_p('vcov',reshape(vcov,(/iip1,jjm,llm/))) 1440 ! call WriteField_p('teta',reshape(teta,(/iip1,jmp1,llm/))) 1441 ! call WriteField_p('ps',reshape(ps,(/iip1,jmp1/))) 1442 endif ! of if (ok_dyn_ins) 1385 1443 #endif 1386 1444 ! For some Grads outputs of fields … … 1399 1457 endif ! of if (output_grads_dyn) 1400 1458 c$OMP END MASTER 1459 endif ! of if (leapf.or.(.not.leapf.and.(.not.forward))) 1401 1460 ENDIF ! of IF(MOD(itau,iecri).EQ.0) 1402 1461 … … 1458 1517 itau = itau + 1 1459 1518 ! iday = day_ini+itau/day_step 1460 ! time = FLOAT(itau-(iday-day_ini)*day_step)/day_step+time_01519 ! time = REAL(itau-(iday-day_ini)*day_step)/day_step+time_0 1461 1520 ! 1462 1521 ! IF(time.GT.1.) THEN … … 1477 1536 GO TO 2 1478 1537 1479 ELSE ! of IF(forward) 1538 ELSE ! of IF(forward) i.e. backward step 1480 1539 1481 1540 IF(MOD(itau,iperiod).EQ.0 .OR. itau.EQ.itaufin) THEN … … 1488 1547 IF (ok_dynzon) THEN 1489 1548 c$OMP BARRIER 1490 1491 1549 call Register_Hallo(vcov,ip1jm,llm,1,0,0,1,TestRequest) 1492 1550 call SendRequest(TestRequest) 1493 1551 c$OMP BARRIER 1494 1552 call WaitRequest(TestRequest) 1495 1496 1553 c$OMP BARRIER 1497 1554 c$OMP MASTER … … 1503 1560 END IF !ok_dynzon 1504 1561 #endif 1562 IF (ok_dyn_ave) THEN 1563 !$OMP MASTER 1564 #ifdef CPP_IOIPSL 1565 ! Ehouarn: Gather fields and make master send to output 1566 call Gather_Field(vcov,ip1jm,llm,0) 1567 call Gather_Field(ucov,ip1jmp1,llm,0) 1568 call Gather_Field(teta,ip1jmp1,llm,0) 1569 call Gather_Field(pk,ip1jmp1,llm,0) 1570 call Gather_Field(phi,ip1jmp1,llm,0) 1571 do iq=1,nqtot 1572 call Gather_Field(q(1,1,iq),ip1jmp1,llm,0) 1573 enddo 1574 call Gather_Field(masse,ip1jmp1,llm,0) 1575 call Gather_Field(ps,ip1jmp1,1,0) 1576 call Gather_Field(phis,ip1jmp1,1,0) 1577 if (mpi_rank==0) then 1578 CALL writedynav(itau,vcov, 1579 & ucov,teta,pk,phi,q,masse,ps,phis) 1580 endif 1581 #endif 1582 !$OMP END MASTER 1583 ENDIF ! of IF (ok_dyn_ave) 1584 1505 1585 ENDIF ! of IF(MOD(itau,iperiod).EQ.0 .OR. itau.EQ.itaufin) 1506 1586 1507 1587 1508 cIF(MOD(itau,iecri ).EQ.0) THEN1509 IF(MOD(itau,iecri*day_step).EQ.0) THEN1588 IF(MOD(itau,iecri ).EQ.0) THEN 1589 c IF(MOD(itau,iecri*day_step).EQ.0) THEN 1510 1590 c$OMP BARRIER 1511 1591 c$OMP MASTER … … 1540 1620 1541 1621 #ifdef CPP_IOIPSL 1542 1622 if (ok_dyn_ins) then 1623 ! Ehouarn: Gather fields and make master send to output 1624 call Gather_Field(vcov,ip1jm,llm,0) 1625 call Gather_Field(ucov,ip1jmp1,llm,0) 1626 call Gather_Field(teta,ip1jmp1,llm,0) 1627 call Gather_Field(phi,ip1jmp1,llm,0) 1628 do iq=1,nqtot 1629 call Gather_Field(q(1,1,iq),ip1jmp1,llm,0) 1630 enddo 1631 call Gather_Field(masse,ip1jmp1,llm,0) 1632 call Gather_Field(ps,ip1jmp1,1,0) 1633 call Gather_Field(phis,ip1jmp1,1,0) 1634 if (mpi_rank==0) then 1635 CALL writehist(itau,vcov,ucov,teta,phi,q,masse,ps,phis) 1636 endif 1543 1637 ! CALL writehist_p(histid, histvid, itau,vcov , 1544 1638 ! & ucov,teta,phi,q,masse,ps,phis) 1639 endif ! of if (ok_dyn_ins) 1545 1640 #endif 1546 1641 ! For some Grads output (but does it work?) … … 1560 1655 1561 1656 c$OMP END MASTER 1562 ENDIF ! of IF(MOD(itau,iecri *day_step).EQ.0)1657 ENDIF ! of IF(MOD(itau,iecri).EQ.0) 1563 1658 1564 1659 IF(itau.EQ.itaufin) THEN
Note: See TracChangeset
for help on using the changeset viewer.