Changeset 3995 for LMDZ6/trunk/libf/dyn3dmem
- Timestamp:
- Oct 29, 2021, 5:38:11 PM (3 years ago)
- Location:
- LMDZ6/trunk/libf/dyn3dmem
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ6/trunk/libf/dyn3dmem/guide_loc_mod.F90
r3984 r3995 9 9 !======================================================================= 10 10 11 USE getparam 11 USE getparam, only: ini_getparam, fin_getparam, getpar 12 12 USE Write_Field_loc 13 13 use netcdf, only: nf90_nowrite, nf90_open, nf90_inq_varid, nf90_close, & 14 14 nf90_inq_dimid, nf90_inquire_dimension 15 15 USE parallel_lmdz 16 USE pres2lev_mod 16 USE pres2lev_mod, only: pres2lev 17 17 18 18 IMPLICIT NONE … … 63 63 REAL, ALLOCATABLE, DIMENSION(:), PRIVATE, SAVE :: psgui1,psgui2 64 64 65 INTEGER,SAVE,PRIVATE :: ijbu,ijbv,ijeu,ijev ,ijnu,ijnv65 INTEGER,SAVE,PRIVATE :: ijbu,ijbv,ijeu,ijev !,ijnu,ijnv 66 66 INTEGER,SAVE,PRIVATE :: jjbu,jjbv,jjeu,jjev,jjnu,jjnv 67 67 … … 175 175 rcod=nf90_open('apbp.nc',Nf90_NOWRITe, ncidpl) 176 176 if (rcod.NE.NF_NOERR) THEN 177 print *,'Guide: probleme -> pas de fichierapbp.nc'177 abort_message=' Nudging error -> no file apbp.nc' 178 178 CALL abort_gcm(modname,abort_message,1) 179 179 endif … … 183 183 rcod=nf90_open('P.nc',Nf90_NOWRITe,ncidpl) 184 184 if (rcod.NE.NF_NOERR) THEN 185 print *,'Guide: probleme -> pas de fichierP.nc'185 abort_message=' Nudging error -> no file P.nc' 186 186 CALL abort_gcm(modname,abort_message,1) 187 187 endif … … 192 192 rcod=nf90_open('u.nc',Nf90_NOWRITe,ncidpl) 193 193 if (rcod.NE.NF_NOERR) THEN 194 print *,'Guide: probleme -> pas de fichieru.nc'194 abort_message=' Nudging error -> no file u.nc' 195 195 CALL abort_gcm(modname,abort_message,1) 196 196 endif … … 203 203 rcod=nf90_open('v.nc',nf90_nowrite,ncidpl) 204 204 if (rcod.NE.NF_NOERR) THEN 205 print *,'Guide: probleme -> pas de fichierv.nc'205 abort_message=' Nudging error -> no file v.nc' 206 206 CALL abort_gcm(modname,abort_message,1) 207 207 endif … … 213 213 rcod=nf90_open('T.nc',nf90_nowrite,ncidpl) 214 214 if (rcod.NE.NF_NOERR) THEN 215 print *,'Guide: probleme -> pas de fichierT.nc'215 abort_message=' Nudging error -> no file T.nc' 216 216 CALL abort_gcm(modname,abort_message,1) 217 217 endif … … 224 224 rcod=nf90_open('hur.nc',nf90_nowrite, ncidpl) 225 225 if (rcod.NE.NF_NOERR) THEN 226 print *,'Guide: probleme -> pas de fichierhur.nc'226 abort_message=' Nudging error -> no file hur.nc' 227 227 CALL abort_gcm(modname,abort_message,1) 228 228 endif … … 234 234 IF (error.NE.NF_NOERR) error=NF_INQ_DIMID(ncidpl,'PRESSURE',rid) 235 235 IF (error.NE.NF_NOERR) THEN 236 print *,'Guide: probleme lecture niveaux pression'236 abort_message='Nudging: error reading pressure levels' 237 237 CALL abort_gcm(modname,abort_message,1) 238 238 ENDIF 239 239 error=NF_INQ_DIMLEN(ncidpl,rid,nlevnc) 240 print *,'Guide: nombre niveaux vert. nlevnc', nlevnc240 write(*,*)trim(modname)//' : number of vertical levels nlevnc', nlevnc 241 241 rcod = nf90_close(ncidpl) 242 242 … … 244 244 ! Allocation des variables 245 245 ! --------------------------------------------- 246 abort_message=' pb in allocation guide'246 abort_message='nudging allocation error' 247 247 248 248 ALLOCATE(apnc(nlevnc), stat = error) … … 395 395 396 396 INTEGER :: i,j,l 397 INTEGER,EXTERNAL :: OMP_GET_THREAD_NUM397 CHARACTER(LEN=20) :: modname="guide_main" 398 398 399 399 !$OMP MASTER 400 ijbu=ij_begin ; ijeu=ij_end ; ijnu=ijeu-ijbu+1400 ijbu=ij_begin ; ijeu=ij_end 401 401 jjbu=jj_begin ; jjeu=jj_end ; jjnu=jjeu-jjbu+1 402 ijbv=ij_begin ; ijev=ij_end ; ijnv=ijev-ijbv+1402 ijbv=ij_begin ; ijev=ij_end 403 403 jjbv=jj_begin ; jjev=jj_end ; jjnv=jjev-jjbv+1 404 404 IF (pole_sud) THEN 405 ijeu=ij_end-iip1 405 406 ijev=ij_end-iip1 406 407 jjev=jj_end-1 407 ijnv=ijev-ijbv+1408 408 jjnv=jjev-jjbv+1 409 ENDIF 410 IF (pole_nord) THEN 411 ijbu=ij_begin+iip1 412 ijbv=ij_begin 409 413 ENDIF 410 414 !$OMP END MASTER … … 493 497 IF (reste.EQ.0.) THEN 494 498 IF (itau_test.EQ.itau) THEN 495 write(*,*)'deuxieme passage de advreel a itau=',itau 496 stop 499 write(*,*)trim(modname)//' second pass in advreel at itau=',& 500 itau 501 stop 497 502 ELSE 498 503 !$OMP MASTER … … 507 512 step_rea=step_rea+1 508 513 itau_test=itau 509 print*,'Lecture fichiers guidage, pas ',step_rea, & 510 'apres ',count_no_rea,' non lectures' 514 if (is_master) then 515 write(*,*)trim(modname)//' Reading nudging files, step ',& 516 step_rea,'after ',count_no_rea,' skips' 517 endif 511 518 IF (guide_2D) THEN 512 519 !$OMP MASTER … … 547 554 548 555 549 556 !----------------------------------------------------------------------- 550 557 ! Ajout des champs de guidage 551 558 !----------------------------------------------------------------------- … … 576 583 ENDDO 577 584 578 !!$OMP MASTER579 ! DO l=1,llm,5580 ! print*,'avant dump2d l=',l,mpi_rank,OMP_GET_THREAD_NUM()581 ! print*,'avant dump2d l=',l,mpi_rank582 ! CALL dump2d(iip1,jjnb_u,p(:,l),'ppp ')583 ! ENDDO584 !!$OMP END MASTER585 !!$OMP BARRIER586 587 585 CALL guide_out("SP",jjp1,llm,p(ijb_u:ije_u,1:llm),1.) 588 586 ENDIF … … 605 603 if (guide_zon) CALL guide_zonave_u(1,llm,f_addu) 606 604 CALL guide_addfield_u(llm,f_addu,alpha_u) 607 ! IF (f_out) CALL guide_out("ua",jjp1,llm,ugui1(ijb_u:ije_u,:),factt)608 605 IF (f_out) CALL guide_out("ua",jjp1,llm,(1.-tau)*ugui1(ijb_u:ije_u,:)+tau*ugui2(ijb_u:ije_u,:),factt) 609 606 IF (f_out) CALL guide_out("u",jjp1,llm,ucov(ijb_u:ije_u,:),factt) 610 IF (f_out) CALL guide_out("ucov",jjp1,llm,f_addu(ijb_u:ije_u,:)/factt,factt) 607 IF (f_out) THEN 608 ! Ehouarn: fill the gaps adequately... 609 IF (ijbu>ijb_u) f_addu(ijb_u:ijbu-1,:)=0 610 IF (ijeu<ije_u) f_addu(ijeu+1:ije_u,:)=0 611 CALL guide_out("ucov",jjp1,llm,f_addu(ijb_u:ije_u,:)/factt,factt) 612 ENDIF 611 613 !$OMP DO SCHEDULE(STATIC,OMP_CHUNK) 612 614 DO l=1,llm … … 703 705 IF (f_out) CALL guide_out("v",jjm,llm,vcov(ijb_v:ije_v,:),factt) 704 706 IF (f_out) CALL guide_out("va",jjm,llm,(1.-tau)*vgui1(ijb_v:ije_v,:)+tau*vgui2(ijb_v:ije_v,:),factt) 705 IF (f_out) CALL guide_out("vcov",jjm,llm,f_addv(:,:)/factt,factt) 707 IF (f_out) THEN 708 ! Ehouarn: Fill in the gaps adequately 709 IF (ijbv>ijb_v) f_addv(ijb_v:ijbv-1,:)=0 710 IF (ijev<ije_v) f_addv(ijev+1:ije_v,:)=0 711 CALL guide_out("vcov",jjm,llm,f_addv(ijb_v:ije_v,:)/factt,factt) 712 ENDIF 706 713 707 714 !$OMP DO SCHEDULE(STATIC,OMP_CHUNK) … … 939 946 940 947 INTEGER :: i,j,l,ij 948 CHARACTER(LEN=20),PARAMETER :: modname="guide_interp" 941 949 TYPE(Request),SAVE :: Req 942 950 !$OMP THREADPRIVATE(Req) 943 print *,'Guide: conversion variables guidage' 951 952 if (is_master) write(*,*)trim(modname)//': interpolate nudging variables' 944 953 ! ----------------------------------------------------------------- 945 954 ! Calcul des niveaux de pression champs guidage (pour T et Q) … … 986 995 first=.FALSE. 987 996 !$OMP MASTER 988 print*,'Guide: verification ordre niveaux verticaux'989 print*,'LMDZ :'997 write(*,*)trim(modname)//' : check vertical level order' 998 write(*,*)trim(modname)//' LMDZ :' 990 999 do l=1,llm 991 print*,'PL(',l,')=',(ap(l)+ap(l+1))/2. &1000 write(*,*)trim(modname)//' PL(',l,')=',(ap(l)+ap(l+1))/2. & 992 1001 +psi(1,jjeu)*(bp(l)+bp(l+1))/2. 993 1002 enddo 994 print*,'Fichiers guidage'1003 write(*,*)trim(modname)//' nudging file :' 995 1004 SELECT CASE (guide_plevs) 996 1005 CASE (0) 997 1006 do l=1,nlevnc 998 print*,'PL(',l,')=',plnc2(1,jjbu,l)1007 write(*,*)trim(modname)//' PL(',l,')=',plnc2(1,jjbu,l) 999 1008 enddo 1000 1009 CASE (1) 1001 1010 DO l=1,nlevnc 1002 print*,'PL(',l,')=',apnc(l)+bpnc(l)*psnat2(i,jjbu) 1003 ENDDO 1011 write(*,*)trim(modname)//' PL(',l,')=',& 1012 apnc(l)+bpnc(l)*psnat2(i,jjbu) 1013 ENDDO 1004 1014 CASE (2) 1005 1015 do l=1,nlevnc 1006 print*,'PL(',l,')=',pnat2(1,jjbu,l)1016 write(*,*)trim(modname)//' PL(',l,')=',pnat2(1,jjbu,l) 1007 1017 enddo 1008 1018 END SELECT 1009 print *,'inversion de l''ordre: invert_p=',invert_p1019 write(*,*)trim(modname)//' invert ordering: invert_p=',invert_p 1010 1020 if (guide_u) then 1011 1021 do l=1,nlevnc 1012 print*,'U(',l,')=',unat2(1,jjbu,l)1022 write(*,*)trim(modname)//' U(',l,')=',unat2(1,jjbu,l) 1013 1023 enddo 1014 1024 endif 1015 1025 if (guide_T) then 1016 1026 do l=1,nlevnc 1017 print*,'T(',l,')=',tnat2(1,jjbu,l)1027 write(*,*)trim(modname)//' T(',l,')=',tnat2(1,jjbu,l) 1018 1028 enddo 1019 1029 endif 1020 1030 !$OMP END MASTER 1021 endif 1031 endif ! of if (first) 1022 1032 1023 1033 ! ----------------------------------------------------------------- … … 1415 1425 real alphamin,alphamax,xi 1416 1426 integer i,j,ilon,ilat 1427 character(len=20),parameter :: modname="tau2alpha" 1417 1428 1418 1429 … … 1503 1514 ! Calcul de gamma 1504 1515 if (abs(grossismx-1.).lt.0.1.or.abs(grossismy-1.).lt.0.1) then 1505 print*,'ATTENTION modele peu zoome'1506 print*,'ATTENTION on prend une constante de guidage cste'1507 1516 write(*,*)trim(modname)//' ATTENTION modele peu zoome' 1517 write(*,*)trim(modname)//' ATTENTION on prend une constante de guidage cste' 1518 gamma=0. 1508 1519 else 1509 1510 print*,'gamma=',gamma1511 1512 print*,'gamma =',gamma,'<1e-5'1513 1514 1515 1516 1517 1518 1519 print*,'gamma=',gamma1520 gamma=(dxdy_max-2.*dxdy_min)/(dxdy_max-dxdy_min) 1521 write(*,*)trim(modname)//' gamma=',gamma 1522 if (gamma.lt.1.e-5) then 1523 write(*,*)trim(modname)//' gamma =',gamma,'<1e-5' 1524 stop 1525 endif 1526 gamma=log(0.5)/log(gamma) 1527 if (gamma4) then 1528 gamma=min(gamma,4.) 1529 endif 1530 write(*,*)trim(modname)//' gamma=',gamma 1520 1531 endif 1521 1532 ENDIF !first … … 1558 1569 IMPLICIT NONE 1559 1570 1560 #include "netcdf.inc"1561 #include "dimensions.h"1562 #include "paramet.h"1571 include "netcdf.inc" 1572 include "dimensions.h" 1573 include "paramet.h" 1563 1574 1564 1575 INTEGER, INTENT(IN) :: timestep … … 1582 1593 if (first) then 1583 1594 ncidpl=-99 1584 print*,'Guide: ouverture des fichiers guidage'1595 write(*,*),trim(modname)//': opening nudging files ' 1585 1596 ! Ap et Bp si Niveaux de pression hybrides 1586 1597 if (guide_plevs.EQ.1) then 1587 print *,'Lecture du guidage sur niveaux modele'1598 write(*,*),trim(modname)//' Reading nudging on model levels' 1588 1599 rcode = nf90_open('apbp.nc', nf90_nowrite, ncidpl) 1589 1600 IF (rcode.NE.NF_NOERR) THEN 1590 print *,'Guide: probleme -> pas de fichierapbp.nc'1601 abort_message='Nudging: error -> no file apbp.nc' 1591 1602 CALL abort_gcm(modname,abort_message,1) 1592 1603 ENDIF 1593 1604 rcode = nf90_inq_varid(ncidpl, 'AP', varidap) 1594 1605 IF (rcode.NE.NF_NOERR) THEN 1595 print *,'Guide: probleme -> pas de variable AP, fichierapbp.nc'1606 abort_message='Nudging: error -> no AP variable in file apbp.nc' 1596 1607 CALL abort_gcm(modname,abort_message,1) 1597 1608 ENDIF 1598 1609 rcode = nf90_inq_varid(ncidpl, 'BP', varidbp) 1599 1610 IF (rcode.NE.NF_NOERR) THEN 1600 print *,'Guide: probleme -> pas de variable BP, fichierapbp.nc'1611 abort_message='Nudging: error -> no BP variable in file apbp.nc' 1601 1612 CALL abort_gcm(modname,abort_message,1) 1602 1613 ENDIF 1603 print*,'ncidpl,varidap',ncidpl,varidap1614 write(*,*),trim(modname)//' ncidpl,varidap',ncidpl,varidap 1604 1615 endif 1605 1616 … … 1608 1619 rcode = nf90_open('P.nc', nf90_nowrite, ncidp) 1609 1620 IF (rcode.NE.NF_NOERR) THEN 1610 print *,'Guide: probleme -> pas de fichierP.nc'1621 abort_message='Nudging: error -> no file P.nc' 1611 1622 CALL abort_gcm(modname,abort_message,1) 1612 1623 ENDIF 1613 1624 rcode = nf90_inq_varid(ncidp, 'PRES', varidp) 1614 1625 IF (rcode.NE.NF_NOERR) THEN 1615 print *,'Guide: probleme -> pas de variable PRES, fichierP.nc'1626 abort_message='Nudging: error -> no PRES variable in file P.nc' 1616 1627 CALL abort_gcm(modname,abort_message,1) 1617 1628 ENDIF 1618 print*,'ncidp,varidp',ncidp,varidp1629 write(*,*),trim(modname)//' ncidp,varidp',ncidp,varidp 1619 1630 if (ncidpl.eq.-99) ncidpl=ncidp 1620 1631 endif … … 1624 1635 rcode = nf90_open('u.nc', nf90_nowrite, ncidu) 1625 1636 IF (rcode.NE.NF_NOERR) THEN 1626 print *,'Guide: probleme -> pas de fichieru.nc'1637 abort_message='Nudging: error -> no file u.nc' 1627 1638 CALL abort_gcm(modname,abort_message,1) 1628 1639 ENDIF 1629 1640 rcode = nf90_inq_varid(ncidu, 'UWND', varidu) 1630 1641 IF (rcode.NE.NF_NOERR) THEN 1631 print *,'Guide: probleme -> pas de variable UWND, fichieru.nc'1642 abort_message='Nudging: error -> no UWND variable in file u.nc' 1632 1643 CALL abort_gcm(modname,abort_message,1) 1633 1644 ENDIF 1634 print*,'ncidu,varidu',ncidu,varidu1645 write(*,*),trim(modname)//' ncidu,varidu',ncidu,varidu 1635 1646 if (ncidpl.eq.-99) ncidpl=ncidu 1636 1647 … … 1639 1650 status=NF90_INQUIRE_DIMENSION(ncidu,dimid,namedim,lendim) 1640 1651 IF (lendim .NE. iip1) THEN 1641 print *,'dimension LONU different from iip1 in u.nc'1652 abort_message='dimension LONU different from iip1 in u.nc' 1642 1653 CALL abort_gcm(modname,abort_message,1) 1643 1654 ENDIF … … 1646 1657 status=NF90_INQUIRE_DIMENSION(ncidu,dimid,namedim,lendim) 1647 1658 IF (lendim .NE. jjp1) THEN 1648 print *,'dimension LATU different from jjp1 in u.nc'1659 abort_message='dimension LATU different from jjp1 in u.nc' 1649 1660 CALL abort_gcm(modname,abort_message,1) 1650 1661 ENDIF … … 1656 1667 rcode = nf90_open('v.nc', nf90_nowrite, ncidv) 1657 1668 IF (rcode.NE.NF_NOERR) THEN 1658 print *,'Guide: probleme -> pas de fichierv.nc'1669 abort_message='Nudging: error -> no file v.nc' 1659 1670 CALL abort_gcm(modname,abort_message,1) 1660 1671 ENDIF 1661 1672 rcode = nf90_inq_varid(ncidv, 'VWND', varidv) 1662 1673 IF (rcode.NE.NF_NOERR) THEN 1663 print *,'Guide: probleme -> pas de variable VWND, fichierv.nc'1674 abort_message='Nudging: error -> no VWND variable in file v.nc' 1664 1675 CALL abort_gcm(modname,abort_message,1) 1665 1676 ENDIF 1666 print*,'ncidv,varidv',ncidv,varidv1677 write(*,*),trim(modname)//' ncidv,varidv',ncidv,varidv 1667 1678 if (ncidpl.eq.-99) ncidpl=ncidv 1668 1679 … … 1671 1682 1672 1683 IF (lendim .NE. iip1) THEN 1673 print *,'dimension LONV different from iip1 in v.nc'1684 abort_message='dimension LONV different from iip1 in v.nc' 1674 1685 CALL abort_gcm(modname,abort_message,1) 1675 1686 ENDIF … … 1679 1690 status=NF90_INQUIRE_DIMENSION(ncidv,dimid,namedim,lendim) 1680 1691 IF (lendim .NE. jjm) THEN 1681 print *,'dimension LATV different from jjm in v.nc'1692 abort_message='dimension LATV different from jjm in v.nc' 1682 1693 CALL abort_gcm(modname,abort_message,1) 1683 1694 ENDIF … … 1689 1700 rcode = nf90_open('T.nc', nf90_nowrite, ncidt) 1690 1701 IF (rcode.NE.NF_NOERR) THEN 1691 print *,'Guide: probleme -> pas de fichierT.nc'1702 abort_message='Nudging: error -> no file T.nc' 1692 1703 CALL abort_gcm(modname,abort_message,1) 1693 1704 ENDIF 1694 1705 rcode = nf90_inq_varid(ncidt, 'AIR', varidt) 1695 1706 IF (rcode.NE.NF_NOERR) THEN 1696 print *,'Guide: probleme -> pas de variable AIR, fichierT.nc'1707 abort_message='Nudging: error -> no AIR variable in file T.nc' 1697 1708 CALL abort_gcm(modname,abort_message,1) 1698 1709 ENDIF 1699 print*,'ncidT,varidT',ncidt,varidt1710 write(*,*),trim(modname)//' ncidT,varidT',ncidt,varidt 1700 1711 if (ncidpl.eq.-99) ncidpl=ncidt 1701 1712 … … 1703 1714 status=NF90_INQUIRE_DIMENSION(ncidt,dimid,namedim,lendim) 1704 1715 IF (lendim .NE. iip1) THEN 1705 print *,'dimension LONV different from iip1 in T.nc'1716 abort_message='dimension LONV different from iip1 in T.nc' 1706 1717 CALL abort_gcm(modname,abort_message,1) 1707 1718 ENDIF … … 1710 1721 status=NF90_INQUIRE_DIMENSION(ncidt,dimid,namedim,lendim) 1711 1722 IF (lendim .NE. jjp1) THEN 1712 print *,'dimension LATU different from jjp1 in T.nc'1723 abort_message='dimension LATU different from jjp1 in T.nc' 1713 1724 CALL abort_gcm(modname,abort_message,1) 1714 1725 ENDIF … … 1720 1731 rcode = nf90_open('hur.nc', nf90_nowrite, ncidQ) 1721 1732 IF (rcode.NE.NF_NOERR) THEN 1722 print *,'Guide: probleme -> pas de fichierhur.nc'1733 abort_message='Nudging: error -> no file hur.nc' 1723 1734 CALL abort_gcm(modname,abort_message,1) 1724 1735 ENDIF 1725 1736 rcode = nf90_inq_varid(ncidQ, 'RH', varidQ) 1726 1737 IF (rcode.NE.NF_NOERR) THEN 1727 print *,'Guide: probleme -> pas de variable RH, fichierhur.nc'1738 abort_message='Nudging: error -> no RH variable in file hur.nc' 1728 1739 CALL abort_gcm(modname,abort_message,1) 1729 1740 ENDIF 1730 print*,'ncidQ,varidQ',ncidQ,varidQ1741 write(*,*),trim(modname)//' ncidQ,varidQ',ncidQ,varidQ 1731 1742 if (ncidpl.eq.-99) ncidpl=ncidQ 1732 1743 … … 1735 1746 status=NF90_INQUIRE_DIMENSION(ncidQ,dimid,namedim,lendim) 1736 1747 IF (lendim .NE. iip1) THEN 1737 print *,'dimension LONV different from iip1 in hur.nc'1748 abort_message='dimension LONV different from iip1 in hur.nc' 1738 1749 CALL abort_gcm(modname,abort_message,1) 1739 1750 ENDIF … … 1742 1753 status=NF90_INQUIRE_DIMENSION(ncidQ,dimid,namedim,lendim) 1743 1754 IF (lendim .NE. jjp1) THEN 1744 print *,'dimension LATU different from jjp1 in hur.nc'1755 abort_message='dimension LATU different from jjp1 in hur.nc' 1745 1756 CALL abort_gcm(modname,abort_message,1) 1746 1757 ENDIF … … 1752 1763 rcode = nf90_open('ps.nc', nf90_nowrite, ncidps) 1753 1764 IF (rcode.NE.NF_NOERR) THEN 1754 print *,'Guide: probleme -> pas de fichierps.nc'1765 abort_message='Nudging: error -> no file ps.nc' 1755 1766 CALL abort_gcm(modname,abort_message,1) 1756 1767 ENDIF 1757 1768 rcode = nf90_inq_varid(ncidps, 'SP', varidps) 1758 1769 IF (rcode.NE.NF_NOERR) THEN 1759 print *,'Guide: probleme -> pas de variable SP, fichierps.nc'1770 abort_message='Nudging: error -> no SP variable in file ps.nc' 1760 1771 CALL abort_gcm(modname,abort_message,1) 1761 1772 ENDIF 1762 print*,'ncidps,varidps',ncidps,varidps1773 write(*,*),trim(modname)//' ncidps,varidps',ncidps,varidps 1763 1774 endif 1764 1775 ! Coordonnee verticale … … 1766 1777 rcode = nf90_inq_varid(ncidpl, 'LEVEL', varidpl) 1767 1778 IF (rcode.NE.0) rcode = nf90_inq_varid(ncidpl, 'PRESSURE', varidpl) 1768 print*,'ncidpl,varidpl',ncidpl,varidpl1779 write(*,*),trim(modname)//' ncidpl,varidpl',ncidpl,varidpl 1769 1780 endif 1770 1781 ! Coefs ap, bp pour calcul de la pression aux differents niveaux … … 1911 1922 IMPLICIT NONE 1912 1923 1913 #include "netcdf.inc"1914 #include "dimensions.h"1915 #include "paramet.h"1924 include "netcdf.inc" 1925 include "dimensions.h" 1926 include "paramet.h" 1916 1927 1917 1928 INTEGER, INTENT(IN) :: timestep … … 1938 1949 if (first) then 1939 1950 ncidpl=-99 1940 print*,'Guide: ouverture des fichiers guidage'1951 write(*,*)trim(modname)//' : opening nudging files ' 1941 1952 ! Ap et Bp si niveaux de pression hybrides 1942 1953 if (guide_plevs.EQ.1) then 1943 print *,'Lecture du guidage sur niveaux mod�le'1944 1945 1946 print *,'Guide: probleme -> pas de fichierapbp.nc'1947 1948 1949 1950 1951 print *,'Guide: probleme -> pas de variable AP, fichierapbp.nc'1952 1953 1954 1955 1956 print *,'Guide: probleme -> pas de variable BP, fichierapbp.nc'1957 1958 1959 print*,'ncidpl,varidap',ncidpl,varidap1954 write(*,*)trim(modname)//' Reading nudging on model levels' 1955 rcode = nf90_open('apbp.nc', nf90_nowrite, ncidpl) 1956 IF (rcode.NE.NF_NOERR) THEN 1957 abort_message='Nudging: error -> no file apbp.nc' 1958 CALL abort_gcm(modname,abort_message,1) 1959 ENDIF 1960 rcode = nf90_inq_varid(ncidpl, 'AP', varidap) 1961 IF (rcode.NE.NF_NOERR) THEN 1962 abort_message='Nudging: error -> no AP variable in file apbp.nc' 1963 CALL abort_gcm(modname,abort_message,1) 1964 ENDIF 1965 rcode = nf90_inq_varid(ncidpl, 'BP', varidbp) 1966 IF (rcode.NE.NF_NOERR) THEN 1967 abort_message='Nudging: error -> no BP variable in file apbp.nc' 1968 CALL abort_gcm(modname,abort_message,1) 1969 ENDIF 1970 write(*,*)trim(modname)//'ncidpl,varidap',ncidpl,varidap 1960 1971 endif 1961 1972 ! Pression 1962 1973 if (guide_plevs.EQ.2) then 1963 1964 1965 print *,'Guide: probleme -> pas de fichierP.nc'1966 1967 1968 1969 1970 print *,'Guide: probleme -> pas de variable PRES, fichierP.nc'1971 1972 1973 print*,'ncidp,varidp',ncidp,varidp1974 1974 rcode = nf90_open('P.nc', nf90_nowrite, ncidp) 1975 IF (rcode.NE.NF_NOERR) THEN 1976 abort_message='Nudging: error -> no file P.nc' 1977 CALL abort_gcm(modname,abort_message,1) 1978 ENDIF 1979 rcode = nf90_inq_varid(ncidp, 'PRES', varidp) 1980 IF (rcode.NE.NF_NOERR) THEN 1981 abort_message='Nudging: error -> no PRES variable in file P.nc' 1982 CALL abort_gcm(modname,abort_message,1) 1983 ENDIF 1984 write(*,*)trim(modname)//' ncidp,varidp',ncidp,varidp 1985 if (ncidpl.eq.-99) ncidpl=ncidp 1975 1986 endif 1976 1987 ! Vent zonal 1977 1988 if (guide_u) then 1978 1979 1980 print *,'Guide: probleme -> pas de fichieru.nc'1981 1982 1983 1984 1985 print *,'Guide: probleme -> pas de variable UWND, fichieru.nc'1986 1987 1988 print*,'ncidu,varidu',ncidu,varidu1989 1989 rcode = nf90_open('u.nc', nf90_nowrite, ncidu) 1990 IF (rcode.NE.NF_NOERR) THEN 1991 abort_message='Nudging: error -> no file u.nc' 1992 CALL abort_gcm(modname,abort_message,1) 1993 ENDIF 1994 rcode = nf90_inq_varid(ncidu, 'UWND', varidu) 1995 IF (rcode.NE.NF_NOERR) THEN 1996 abort_message='Nudging: error -> no UWND variable in file u.nc' 1997 CALL abort_gcm(modname,abort_message,1) 1998 ENDIF 1999 write(*,*)trim(modname)//' ncidu,varidu',ncidu,varidu 2000 if (ncidpl.eq.-99) ncidpl=ncidu 1990 2001 endif 1991 2002 1992 2003 ! Vent meridien 1993 2004 if (guide_v) then 1994 1995 1996 print *,'Guide: probleme -> pas de fichierv.nc'1997 1998 1999 2000 2001 print *,'Guide: probleme -> pas de variable VWND, fichierv.nc'2002 2003 2004 print*,'ncidv,varidv',ncidv,varidv2005 2006 2005 rcode = nf90_open('v.nc', nf90_nowrite, ncidv) 2006 IF (rcode.NE.NF_NOERR) THEN 2007 abort_message='Nudging: error -> no file v.nc' 2008 CALL abort_gcm(modname,abort_message,1) 2009 ENDIF 2010 rcode = nf90_inq_varid(ncidv, 'VWND', varidv) 2011 IF (rcode.NE.NF_NOERR) THEN 2012 abort_message='Nudging: error -> no VWND variable in file v.nc' 2013 CALL abort_gcm(modname,abort_message,1) 2014 ENDIF 2015 write(*,*)trim(modname)//' ncidv,varidv',ncidv,varidv 2016 if (ncidpl.eq.-99) ncidpl=ncidv 2017 endif 2007 2018 ! Temperature 2008 2019 if (guide_T) then 2009 2010 2011 print *,'Guide: probleme -> pas de fichierT.nc'2012 2013 2014 2015 2016 print *,'Guide: probleme -> pas de variable AIR, fichierT.nc'2017 2018 2019 print*,'ncidT,varidT',ncidt,varidt2020 2020 rcode = nf90_open('T.nc', nf90_nowrite, ncidt) 2021 IF (rcode.NE.NF_NOERR) THEN 2022 abort_message='Nudging: error -> no file T.nc' 2023 CALL abort_gcm(modname,abort_message,1) 2024 ENDIF 2025 rcode = nf90_inq_varid(ncidt, 'AIR', varidt) 2026 IF (rcode.NE.NF_NOERR) THEN 2027 abort_message='Nudging: error -> no AIR variable in file T.nc' 2028 CALL abort_gcm(modname,abort_message,1) 2029 ENDIF 2030 write(*,*)trim(modname)//' ncidT,varidT',ncidt,varidt 2031 if (ncidpl.eq.-99) ncidpl=ncidt 2021 2032 endif 2022 2033 ! Humidite 2023 2034 if (guide_Q) then 2024 2025 2026 print *,'Guide: probleme -> pas de fichierhur.nc'2027 2028 2029 2030 2031 print *,'Guide: probleme -> pas de variable RH, fichierhur.nc'2032 2033 2034 print*,'ncidQ,varidQ',ncidQ,varidQ2035 2035 rcode = nf90_open('hur.nc', nf90_nowrite, ncidQ) 2036 IF (rcode.NE.NF_NOERR) THEN 2037 abort_message='Nudging: error -> no file hur.nc' 2038 CALL abort_gcm(modname,abort_message,1) 2039 ENDIF 2040 rcode = nf90_inq_varid(ncidQ, 'RH', varidQ) 2041 IF (rcode.NE.NF_NOERR) THEN 2042 abort_message='Nudging: error -> no RH,variable in file hur.nc' 2043 CALL abort_gcm(modname,abort_message,1) 2044 ENDIF 2045 write(*,*)trim(modname)//' ncidQ,varidQ',ncidQ,varidQ 2046 if (ncidpl.eq.-99) ncidpl=ncidQ 2036 2047 endif 2037 2048 ! Pression de surface 2038 2049 if ((guide_P).OR.(guide_plevs.EQ.1)) then 2039 2040 2041 print *,'Guide: probleme -> pas de fichierps.nc'2042 2043 2044 2045 2046 print *,'Guide: probleme -> pas de variable SP, fichierps.nc'2047 2048 2049 print*,'ncidps,varidps',ncidps,varidps2050 rcode = nf90_open('ps.nc', nf90_nowrite, ncidps) 2051 IF (rcode.NE.NF_NOERR) THEN 2052 abort_message='Nudging: error -> no file ps.nc' 2053 CALL abort_gcm(modname,abort_message,1) 2054 ENDIF 2055 rcode = nf90_inq_varid(ncidps, 'SP', varidps) 2056 IF (rcode.NE.NF_NOERR) THEN 2057 abort_message='Nudging: error -> no SP variable in file ps.nc' 2058 CALL abort_gcm(modname,abort_message,1) 2059 ENDIF 2060 write(*,*)trim(modname)//' ncidps,varidps',ncidps,varidps 2050 2061 endif 2051 2062 ! Coordonnee verticale 2052 2063 if (guide_plevs.EQ.0) then 2053 2054 2055 print*,'ncidpl,varidpl',ncidpl,varidpl2064 rcode = nf90_inq_varid(ncidpl, 'LEVEL', varidpl) 2065 IF (rcode.NE.0) rcode = nf90_inq_varid(ncidpl, 'PRESSURE', varidpl) 2066 write(*,*)trim(modname)//' ncidpl,varidpl',ncidpl,varidpl 2056 2067 endif 2057 2068 ! Coefs ap, bp pour calcul de la pression aux differents niveaux … … 2247 2258 REAL zu(ip1jmp1),zv(ip1jm), zt(iip1, jjp1), zq(iip1, jjp1) 2248 2259 REAL, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: field_glo 2260 CHARACTER(LEN=20),PARAMETER :: modname="guide_out" 2249 2261 2250 2262 !$OMP MASTER … … 2253 2265 !$OMP BARRIER 2254 2266 2255 print*,'gvide_out apresallocation ',hsize,vsize2267 ! write(*,*)trim(modname)//' after allocation ',hsize,vsize 2256 2268 2257 2269 IF (hsize==jjp1) THEN … … 2261 2273 ENDIF 2262 2274 2263 print*,'guide_out apresgather '2275 ! write(*,*)trim(modname)//' after gather ' 2264 2276 CALL Gather_field_u(alpha_u,zu,1) 2265 2277 CALL Gather_field_u(alpha_t,zt,1) … … 2431 2443 !$OMP BARRIER 2432 2444 2433 RETURN2434 2435 2445 END SUBROUTINE guide_out 2436 2446 -
LMDZ6/trunk/libf/dyn3dmem/parallel_lmdz.F90
r2771 r3995 12 12 INTEGER,PARAMETER :: halo_max=3 13 13 14 LOGICAL,SAVE :: using_mpi 15 LOGICAL,SAVE :: using_omp 14 LOGICAL,SAVE :: using_mpi ! .true. if using MPI 15 LOGICAL,SAVE :: using_omp ! .true. if using OpenMP 16 LOGICAL,SAVE :: is_master ! .true. if the core is both MPI & OpenMP master 17 !$OMP THREADPRIVATE(is_master) 16 18 17 19 integer, save :: mpi_size … … 248 250 !$OMP END PARALLEL 249 251 CALL create_distrib(jj_nb_para,current_dist) 252 253 IF ((mpi_rank==0).and.(omp_rank==0)) THEN 254 is_master=.true. 255 ELSE 256 is_master=.false. 257 ENDIF 250 258 251 259 end subroutine init_parallel
Note: See TracChangeset
for help on using the changeset viewer.