- Timestamp:
- Oct 23, 2018, 11:16:41 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ6/branches/DYNAMICO-conv-GC/libf/phylmd/physiq_mod.F90
r3322 r3406 25 25 USE dimphy 26 26 USE infotrac_phy, ONLY: nqtot, nbtr, nqo, type_trac 27 USE mod_grid_phy_lmdz, ONLY: nbp_lon, nbp_lat, nbp_lev, klon_glo 27 USE mod_grid_phy_lmdz, ONLY: nbp_lon, nbp_lat, nbp_lev, klon_glo, grid1dTo2d_glo, grid_type, unstructured 28 28 USE mod_phys_lmdz_para 29 29 USE iophy … … 252 252 use ACAMA_GWD_rando_m, only: ACAMA_GWD_rando 253 253 USE VERTICAL_LAYERS_MOD, ONLY: aps,bps 254 USE etat0_limit_unstruct_mod 255 #ifdef CPP_XIOS 256 USE xios, ONLY: xios_update_calendar, xios_context_finalize 257 #endif 258 USE climoz_mod 259 USE limit_read_mod, ONLY : init_limit_read 260 USE regr_horiz_time_climoz_m, ONLY: regr_horiz_time_climoz 254 261 255 262 … … 1129 1136 CALL update_time(pdtphys) 1130 1137 phys_tstep=NINT(pdtphys) 1138 #ifdef CPP_XIOS 1139 IF (.NOT. debut .AND. is_omp_master) CALL xios_update_calendar(itap+1) 1140 #endif 1131 1141 1132 1142 !====================================================================== … … 1161 1171 1162 1172 IF (first) THEN 1173 CALL init_etat0_limit_unstruct 1174 IF (.NOT. create_etat0_limit) CALL init_limit_read(days_elapsed) 1163 1175 !CR:nvelles variables convection/poches froides 1164 1176 … … 1184 1196 CALL phys_state_var_init(read_climoz) 1185 1197 CALL phys_output_var_init 1198 IF(read_climoz>=1 .AND. create_etat0_limit) CALL regr_horiz_time_climoz(read_climoz,ok_daily_climoz) 1199 1186 1200 print*, '=================================================' 1187 1201 ! … … 1394 1408 CALL init_iophy_new(latitude_deg,longitude_deg) 1395 1409 1396 1410 !=================================================================== 1411 !IM stations CFMIP 1412 nCFMIP=npCFMIP 1413 OPEN(98,file='npCFMIP_param.data',status='old', & 1414 form='formatted',iostat=iostat) 1415 IF (iostat == 0) THEN 1416 READ(98,*,end=998) nCFMIP 1417 998 CONTINUE 1418 CLOSE(98) 1419 CONTINUE 1420 IF(nCFMIP.GT.npCFMIP) THEN 1421 print*,'nCFMIP > npCFMIP : augmenter npCFMIP et recompiler' 1422 CALL abort_physic("physiq", "", 1) 1423 ELSE 1424 print*,'physiq npCFMIP=',npCFMIP,'nCFMIP=',nCFMIP 1425 ENDIF 1426 1427 ! 1428 ALLOCATE(tabCFMIP(nCFMIP)) 1429 ALLOCATE(lonCFMIP(nCFMIP), latCFMIP(nCFMIP)) 1430 ALLOCATE(tabijGCM(nCFMIP)) 1431 ALLOCATE(lonGCM(nCFMIP), latGCM(nCFMIP)) 1432 ALLOCATE(iGCM(nCFMIP), jGCM(nCFMIP)) 1433 ! 1434 ! lecture des nCFMIP stations CFMIP, de leur numero 1435 ! et des coordonnees geographiques lonCFMIP, latCFMIP 1436 ! 1437 CALL read_CFMIP_point_locations(nCFMIP, tabCFMIP, & 1438 lonCFMIP, latCFMIP) 1439 ! 1440 ! identification des 1441 ! 1) coordonnees lonGCM, latGCM des points CFMIP dans la 1442 ! grille de LMDZ 1443 ! 2) indices points tabijGCM de la grille physique 1d sur 1444 ! klon points 1445 ! 3) indices iGCM, jGCM de la grille physique 2d 1446 ! 1447 CALL LMDZ_CFMIP_point_locations(nCFMIP, lonCFMIP, latCFMIP, & 1448 tabijGCM, lonGCM, latGCM, iGCM, jGCM) 1449 ! 1450 ELSE 1451 ALLOCATE(tabijGCM(0)) 1452 ALLOCATE(lonGCM(0), latGCM(0)) 1453 ALLOCATE(iGCM(0), jGCM(0)) 1454 ENDIF 1455 1456 #ifdef CPP_IOIPSL 1457 1458 !$OMP MASTER 1459 ! FH : if ok_sync=.true. , the time axis is written at each time step 1460 ! in the output files. Only at the end in the opposite case 1461 ok_sync_omp=.false. 1462 CALL getin('ok_sync',ok_sync_omp) 1463 CALL phys_output_open(longitude_deg,latitude_deg,nCFMIP,tabijGCM, & 1464 iGCM,jGCM,lonGCM,latGCM, & 1465 jjmp1,nlevSTD,clevSTD,rlevSTD, phys_tstep,ok_veget, & 1466 type_ocean,iflag_pbl,iflag_pbl_split,ok_mensuel,ok_journe, & 1467 ok_hf,ok_instan,ok_LES,ok_ade,ok_aie, & 1468 read_climoz, phys_out_filestations, & 1469 new_aod, aerosol_couple, & 1470 flag_aerosol_strat, pdtphys, paprs, pphis, & 1471 pplay, lmax_th, ptconv, ptconvth, ivap, & 1472 d_u, d_t, qx, d_qx, zmasse, ok_sync_omp) 1473 !$OMP END MASTER 1474 !$OMP BARRIER 1475 ok_sync=ok_sync_omp 1476 1477 freq_outNMC(1) = ecrit_files(7) 1478 freq_outNMC(2) = ecrit_files(8) 1479 freq_outNMC(3) = ecrit_files(9) 1480 WRITE(lunout,*)'OK freq_outNMC(1)=',freq_outNMC(1) 1481 WRITE(lunout,*)'OK freq_outNMC(2)=',freq_outNMC(2) 1482 WRITE(lunout,*)'OK freq_outNMC(3)=',freq_outNMC(3) 1483 1484 #ifndef CPP_XIOS 1485 CALL ini_paramLMDZ_phy(phys_tstep,nid_ctesGCM) 1486 #endif 1487 1488 #endif 1489 ecrit_reg = ecrit_reg * un_jour 1490 ecrit_tra = ecrit_tra * un_jour 1491 1492 !XXXPB Positionner date0 pour initialisation de ORCHIDEE 1493 date0 = jD_ref 1494 WRITE(*,*) 'physiq date0 : ',date0 1495 ! 1496 1497 ! CALL create_climoz(read_climoz) 1498 1499 CALL phys_output_write(itap, pdtphys, paprs, pphis, & 1500 pplay, lmax_th, aerosol_couple, & 1501 ok_ade, ok_aie, ivap, iliq, isol, new_aod, ok_sync,& 1502 ptconv, read_climoz, clevSTD, & 1503 ptconvth, d_u, d_t, qx, d_qx, zmasse, & 1504 flag_aerosol, flag_aerosol_strat, ok_cdnc) 1505 1506 #ifdef CPP_XIOS 1507 IF (is_omp_master) CALL xios_update_calendar(1) 1508 #endif 1509 IF(read_climoz>=1 .AND. create_etat0_limit) CALL regr_horiz_time_climoz(read_climoz,ok_daily_climoz) 1510 CALL create_etat0_limit_unstruct 1397 1511 CALL phyetat0 ("startphy.nc",clesphy0,tabcntr0) 1512 1398 1513 !jyg< 1399 1514 IF (klon_glo==1) THEN … … 1405 1520 ENDDO 1406 1521 ENDDO 1522 ELSE 1523 pbl_tke(:,:,is_ave) = 0. !ym missing init : maybe must be initialized in the same way that for klon_glo==1 ?? 1407 1524 !>jyg 1408 1525 ENDIF … … 1421 1538 ENDIF 1422 1539 1423 CALL printflag( tabcntr0,radpas,ok_journe, &1424 ok_instan, ok_region )1425 !1426 1540 ! IF (ABS(phys_tstep-pdtphys).GT.0.001) THEN 1427 1541 ! WRITE(lunout,*) 'Pas physique n est pas correct',phys_tstep, & … … 1506 1620 ! enddo 1507 1621 1508 !=================================================================== 1509 !IM stations CFMIP 1510 nCFMIP=npCFMIP 1511 OPEN(98,file='npCFMIP_param.data',status='old', & 1512 form='formatted',iostat=iostat) 1513 IF (iostat == 0) THEN 1514 READ(98,*,end=998) nCFMIP 1515 998 CONTINUE 1516 CLOSE(98) 1517 CONTINUE 1518 IF(nCFMIP.GT.npCFMIP) THEN 1519 print*,'nCFMIP > npCFMIP : augmenter npCFMIP et recompiler' 1520 CALL abort_physic("physiq", "", 1) 1521 ELSE 1522 print*,'physiq npCFMIP=',npCFMIP,'nCFMIP=',nCFMIP 1523 ENDIF 1524 1525 ! 1526 ALLOCATE(tabCFMIP(nCFMIP)) 1527 ALLOCATE(lonCFMIP(nCFMIP), latCFMIP(nCFMIP)) 1528 ALLOCATE(tabijGCM(nCFMIP)) 1529 ALLOCATE(lonGCM(nCFMIP), latGCM(nCFMIP)) 1530 ALLOCATE(iGCM(nCFMIP), jGCM(nCFMIP)) 1531 ! 1532 ! lecture des nCFMIP stations CFMIP, de leur numero 1533 ! et des coordonnees geographiques lonCFMIP, latCFMIP 1534 ! 1535 CALL read_CFMIP_point_locations(nCFMIP, tabCFMIP, & 1536 lonCFMIP, latCFMIP) 1537 ! 1538 ! identification des 1539 ! 1) coordonnees lonGCM, latGCM des points CFMIP dans la 1540 ! grille de LMDZ 1541 ! 2) indices points tabijGCM de la grille physique 1d sur 1542 ! klon points 1543 ! 3) indices iGCM, jGCM de la grille physique 2d 1544 ! 1545 CALL LMDZ_CFMIP_point_locations(nCFMIP, lonCFMIP, latCFMIP, & 1546 tabijGCM, lonGCM, latGCM, iGCM, jGCM) 1547 ! 1548 ELSE 1549 ALLOCATE(tabijGCM(0)) 1550 ALLOCATE(lonGCM(0), latGCM(0)) 1551 ALLOCATE(iGCM(0), jGCM(0)) 1552 ENDIF 1553 ELSE 1554 ALLOCATE(tabijGCM(0)) 1555 ALLOCATE(lonGCM(0), latGCM(0)) 1556 ALLOCATE(iGCM(0), jGCM(0)) 1622 !ELSE 1623 ! ALLOCATE(tabijGCM(0)) 1624 ! ALLOCATE(lonGCM(0), latGCM(0)) 1625 ! ALLOCATE(iGCM(0), jGCM(0)) 1557 1626 ENDIF 1558 1627 … … 1642 1711 #endif 1643 1712 1644 #ifdef CPP_IOIPSL 1645 1646 !$OMP MASTER 1647 ! FH : if ok_sync=.true. , the time axis is written at each time step 1648 ! in the output files. Only at the end in the opposite case 1649 ok_sync_omp=.false. 1650 CALL getin('ok_sync',ok_sync_omp) 1651 CALL phys_output_open(longitude_deg,latitude_deg,nCFMIP,tabijGCM, & 1652 iGCM,jGCM,lonGCM,latGCM, & 1653 jjmp1,nlevSTD,clevSTD,rlevSTD, phys_tstep,ok_veget, & 1654 type_ocean,iflag_pbl,iflag_pbl_split,ok_mensuel,ok_journe, & 1655 ok_hf,ok_instan,ok_LES,ok_ade,ok_aie, & 1656 read_climoz, phys_out_filestations, & 1657 new_aod, aerosol_couple, & 1658 flag_aerosol_strat, pdtphys, paprs, pphis, & 1659 pplay, lmax_th, ptconv, ptconvth, ivap, & 1660 d_u, d_t, qx, d_qx, zmasse, ok_sync_omp) 1661 !$OMP END MASTER 1662 !$OMP BARRIER 1663 ok_sync=ok_sync_omp 1664 1665 freq_outNMC(1) = ecrit_files(7) 1666 freq_outNMC(2) = ecrit_files(8) 1667 freq_outNMC(3) = ecrit_files(9) 1668 WRITE(lunout,*)'OK freq_outNMC(1)=',freq_outNMC(1) 1669 WRITE(lunout,*)'OK freq_outNMC(2)=',freq_outNMC(2) 1670 WRITE(lunout,*)'OK freq_outNMC(3)=',freq_outNMC(3) 1671 1672 #ifndef CPP_XIOS 1673 CALL ini_paramLMDZ_phy(phys_tstep,nid_ctesGCM) 1674 #endif 1675 1676 #endif 1677 ecrit_reg = ecrit_reg * un_jour 1678 ecrit_tra = ecrit_tra * un_jour 1679 1680 !XXXPB Positionner date0 pour initialisation de ORCHIDEE 1681 date0 = jD_ref 1682 WRITE(*,*) 'physiq date0 : ',date0 1713 1714 CALL printflag( tabcntr0,radpas,ok_journe, & 1715 ok_instan, ok_region ) 1683 1716 ! 1684 1717 ! … … 2207 2240 ! 2208 2241 !-------gustiness calculation-------! 2242 !ym : Warning gustiness non inialized for iflag_gusts=2 & iflag_gusts=3 2243 gustiness=0 !ym missing init 2244 2209 2245 IF (iflag_gusts==0) THEN 2210 2246 gustiness(1:klon)=0 … … 4034 4070 4035 4071 IF (.not. ok_hines .and. ok_gwd_rando) then 4072 ! ym missing init for east_gwstress & west_gwstress -> added in phys_local_var_mod 4036 4073 CALL acama_GWD_rando(PHYS_TSTEP, pplay, latitude_deg, t_seri, u_seri, & 4037 4074 v_seri, rot, zustr_gwd_front, zvstr_gwd_front, du_gwd_front, & … … 4696 4733 ! write(97) u_seri,v_seri,t_seri,q_seri 4697 4734 ! close(97) 4698 !$OMP MASTER4735 ! !$OMP MASTER 4699 4736 IF (read_climoz >= 1) THEN 4700 4737 IF (is_mpi_root) THEN … … 4704 4741 DEALLOCATE(press_cen_climoz) ! pointer 4705 4742 ENDIF 4706 !$OMP END MASTER 4743 ! !$OMP END MASTER 4744 #ifdef CPP_XIOS 4745 IF (is_omp_master) CALL xios_context_finalize 4746 #endif 4707 4747 ENDIF 4708 4748
Note: See TracChangeset
for help on using the changeset viewer.