Changeset 5488 for LMDZ6/branches/contrails/libf/phylmd/lmdz_aviation.f90
- Timestamp:
- Jan 17, 2025, 6:12:48 PM (13 days ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ6/branches/contrails/libf/phylmd/lmdz_aviation.f90
r5466 r5488 678 678 ! INCLUDE 'netcdf.inc' 679 679 ! 680 ! !--------------------------------------------------------681 ! !--input variables682 ! !--------------------------------------------------------683 ! LOGICAL, INTENT(IN) :: debut684 ! REAL, INTENT(IN) :: pphis(klon), pplay(klon,klev), paprs(klon,klev+1), t_seri(klon,klev)685 !686 ! !--------------------------------------------------------687 ! ! ... Local variables688 ! !--------------------------------------------------------689 !690 ! CHARACTER (LEN=20) :: modname='airplane_mod'691 ! INTEGER :: i, k, kori, iret, varid, error, ncida, klona692 ! INTEGER,SAVE :: nleva, ntimea693 !!$OMP THREADPRIVATE(nleva,ntimea)694 ! REAL, ALLOCATABLE :: pkm_airpl_glo(:,:,:) !--km/s695 ! REAL, ALLOCATABLE :: ph2o_airpl_glo(:,:,:) !--molec H2O/cm3/s696 ! REAL, ALLOCATABLE, SAVE :: zmida(:), zinta(:)697 ! REAL, ALLOCATABLE, SAVE :: pkm_airpl(:,:,:)698 ! REAL, ALLOCATABLE, SAVE :: ph2o_airpl(:,:,:)699 !!$OMP THREADPRIVATE(pkm_airpl,ph2o_airpl,zmida,zinta)700 ! REAL :: zalt(klon,klev+1)701 ! REAL :: zrho, zdz(klon,klev), zfrac702 !703 ! !704 ! IF (debut) THEN705 ! !--------------------------------------------------------------------------------706 ! ! ... Open the file and read airplane emissions707 ! !--------------------------------------------------------------------------------708 ! !709 ! IF (is_mpi_root .AND. is_omp_root) THEN710 ! !711 ! iret = nf_open('aircraft_phy.nc', 0, ncida)712 ! IF (iret /= NF_NOERR) CALL abort_physic(modname,'problem to open aircraft_phy.nc file',1)713 ! ! ... Get lengths714 ! iret = nf_inq_dimid(ncida, 'time', varid)715 ! IF (iret /= NF_NOERR) CALL abort_physic(modname,'problem to get time dimid in aircraft_phy.nc file',1)716 ! iret = nf_inq_dimlen(ncida, varid, ntimea)717 ! IF (iret /= NF_NOERR) CALL abort_physic(modname,'problem to get time dimlen aircraft_phy.nc file',1)718 ! iret = nf_inq_dimid(ncida, 'vector', varid)719 ! IF (iret /= NF_NOERR) CALL abort_physic(modname,'problem to get vector dimid aircraft_phy.nc file',1)720 ! iret = nf_inq_dimlen(ncida, varid, klona)721 ! IF (iret /= NF_NOERR) CALL abort_physic(modname,'problem to get vector dimlen aircraft_phy.nc file',1)722 ! iret = nf_inq_dimid(ncida, 'lev', varid)723 ! IF (iret /= NF_NOERR) CALL abort_physic(modname,'problem to get lev dimid aircraft_phy.nc file',1)724 ! iret = nf_inq_dimlen(ncida, varid, nleva)725 ! IF (iret /= NF_NOERR) CALL abort_physic(modname,'problem to get lev dimlen aircraft_phy.nc file',1)726 ! !727 ! IF ( klona /= klon_glo ) THEN728 ! WRITE(lunout,*) 'klona & klon_glo =', klona, klon_glo729 ! CALL abort_physic(modname,'problem klon in aircraft_phy.nc file',1)730 ! ENDIF731 ! !732 ! IF ( ntimea /= 12 ) THEN733 ! WRITE(lunout,*) 'ntimea=', ntimea734 ! CALL abort_physic(modname,'problem ntime<>12 in aircraft_phy.nc file',1)735 ! ENDIF736 ! !737 ! ALLOCATE(zmida(nleva), STAT=error)738 ! IF (error /= 0) CALL abort_physic(modname,'problem to allocate zmida',1)739 ! ALLOCATE(pkm_airpl_glo(klona,nleva,ntimea), STAT=error)740 ! IF (error /= 0) CALL abort_physic(modname,'problem to allocate pkm_airpl_glo',1)741 ! ALLOCATE(ph2o_airpl_glo(klona,nleva,ntimea), STAT=error)742 ! IF (error /= 0) CALL abort_physic(modname,'problem to allocate ph2o_airpl_glo',1)743 ! !744 ! iret = nf_inq_varid(ncida, 'lev', varid)745 ! IF (iret /= NF_NOERR) CALL abort_physic(modname,'problem to get lev dimid aircraft_phy.nc file',1)746 ! iret = nf_get_var_double(ncida, varid, zmida)747 ! IF (iret /= NF_NOERR) CALL abort_physic(modname,'problem to read zmida file',1)748 ! !749 ! iret = nf_inq_varid(ncida, 'emi_co2_aircraft', varid) !--CO2 as a proxy for m flown -750 ! IF (iret /= NF_NOERR) CALL abort_physic(modname,'problem to get emi_distance dimid aircraft_phy.nc file',1)751 ! iret = nf_get_var_double(ncida, varid, pkm_airpl_glo)752 ! IF (iret /= NF_NOERR) CALL abort_physic(modname,'problem to read pkm_airpl file',1)753 ! !754 ! iret = nf_inq_varid(ncida, 'emi_h2o_aircraft', varid)755 ! IF (iret /= NF_NOERR) CALL abort_physic(modname,'problem to get emi_h2o_aircraft dimid aircraft_phy.nc file',1)756 ! iret = nf_get_var_double(ncida, varid, ph2o_airpl_glo)757 ! IF (iret /= NF_NOERR) CALL abort_physic(modname,'problem to read ph2o_airpl file',1)758 ! !759 ! ENDIF !--is_mpi_root and is_omp_root760 ! !761 ! CALL bcast(nleva)762 ! CALL bcast(ntimea)763 ! !764 ! IF (.NOT.ALLOCATED(zmida)) ALLOCATE(zmida(nleva), STAT=error)765 ! IF (.NOT.ALLOCATED(zinta)) ALLOCATE(zinta(nleva+1), STAT=error)766 ! !767 ! ALLOCATE(pkm_airpl(klon,nleva,ntimea))768 ! ALLOCATE(ph2o_airpl(klon,nleva,ntimea))769 ! !770 ! ALLOCATE(flight_m(klon,klev))771 ! ALLOCATE(flight_h2o(klon,klev))772 ! !773 ! CALL bcast(zmida)774 ! zinta(1)=0.0 !--surface775 ! DO k=2, nleva776 ! zinta(k) = (zmida(k-1)+zmida(k))/2.0*1000.0 !--conversion from km to m777 ! ENDDO778 ! zinta(nleva+1)=zinta(nleva)+(zmida(nleva)-zmida(nleva-1))*1000.0 !--extrapolation for last interface779 ! !print *,'zinta=', zinta780 ! !781 ! CALL scatter(pkm_airpl_glo,pkm_airpl)782 ! CALL scatter(ph2o_airpl_glo,ph2o_airpl)783 ! !784 !!$OMP MASTER785 ! IF (is_mpi_root .AND. is_omp_root) THEN786 ! DEALLOCATE(pkm_airpl_glo)787 ! DEALLOCATE(ph2o_airpl_glo)788 ! ENDIF !--is_mpi_root789 !!$OMP END MASTER790 !791 ! ENDIF !--debut792 !!793 !!--compute altitude of model level interfaces794 !!795 ! DO i = 1, klon796 ! zalt(i,1)=pphis(i)/RG !--in m797 ! ENDDO798 !!799 ! DO k=1, klev800 ! DO i = 1, klon801 ! zrho=pplay(i,k)/t_seri(i,k)/RD802 ! zdz(i,k)=(paprs(i,k)-paprs(i,k+1))/zrho/RG803 ! zalt(i,k+1)=zalt(i,k)+zdz(i,k) !--in m804 ! ENDDO805 ! ENDDO806 !!807 !!--vertical reprojection808 !!809 ! flight_m(:,:)=0.0810 ! flight_h2o(:,:)=0.0811 !!812 ! DO k=1, klev813 ! DO kori=1, nleva814 ! DO i=1, klon815 ! !--fraction of layer kori included in layer k816 ! zfrac=max(0.0,min(zalt(i,k+1),zinta(kori+1))-max(zalt(i,k),zinta(kori)))/(zinta(kori+1)-zinta(kori))817 ! !--reproject818 ! flight_m(i,k)=flight_m(i,k) + pkm_airpl(i,kori,mth_cur)*zfrac819 ! !--reproject820 ! flight_h2o(i,k)=flight_h2o(i,k) + ph2o_airpl(i,kori,mth_cur)*zfrac821 ! ENDDO822 ! ENDDO823 ! ENDDO824 !!825 ! DO k=1, klev826 ! DO i=1, klon827 ! !--molec.cm-3.s-1 / (molec/mol) * kg CO2/mol * m2 * m * cm3/m3 / (kg CO2/m) => m s-1 per cell828 ! flight_m(i,k)=flight_m(i,k)/RNAVO*44.e-3*cell_area(i)*zdz(i,k)*1.e6/16.37e-3829 ! flight_m(i,k)=flight_m(i,k)*100.0 !--x100 to augment signal to noise830 ! !--molec.cm-3.s-1 / (molec/mol) * kg H2O/mol * m2 * m * cm3/m3 => kg H2O s-1 per cell831 ! flight_h2o(i,k)=flight_h2o(i,k)/RNAVO*18.e-3*cell_area(i)*zdz(i,k)*1.e6832 ! ENDDO833 ! ENDDO834 680 !! 835 681 !END SUBROUTINE airplane
Note: See TracChangeset
for help on using the changeset viewer.