Ignore:
Timestamp:
Jan 10, 2020, 3:07:23 PM (5 years ago)
Author:
dubos
Message:

simple_physics : minor changes to compile with gfortran and parse code using XCodeML F_Front

Location:
dynamico_lmdz/simple_physics/phyparam
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • dynamico_lmdz/simple_physics/phyparam/Makefile

    r4224 r4225  
    1 # Example (bash) :
    2 # clear ; make clean ; F90=ifort FFLAGS=-fast time make -j
     1# Examples (bash) :
     2# clear ; make clean ;
     3# F90=ifort FFLAGS=-fast time make -j
     4# F90=gfortran F90FLAGS=-ffree-line-length-none gmake
     5# known to compile with gfortran version 7, ifort version 17
     6
     7# if XCodeML F_Front is installed, set FFRONT=F_Front to parse code into XML
     8FFRONT ?= true
    39
    410VPATH = obj
     
    915
    1016obj :
    11         @mkdir obj include lib
     17        @mkdir obj include lib xml
    1218
    1319clean :
    14         rm -f obj/* include/* lib/*
     20        rm -f obj/* include/* lib/* xml/*
    1521
    1622%.so : $(OBJECTS)
     
    2834obj/phyparam_mod.o     : MAIN solar.o radiative_sw.o radiative_lw.o comgeomfi.o writefield_mod.o
    2935
     36SRC = $(basename $(notdir $@))
    3037obj/%.o: physics/%.F90
    31         $(F90) -I include -fPIC -c $(F90FLAGS) $< -o $@
    32         @mv $(basename $(notdir $@)).mod include
     38        $(F90) -I include -fPIC $(F90FLAGS) -c $<
     39        @mv $(SRC).mod include
     40        @mv $(SRC).o obj
     41        @cpp -DXCODEML $< > xml/$(SRC).f90
     42        @$(FFRONT) -M xml xml/$(SRC).f90 > xml/$(SRC).xml
  • dynamico_lmdz/simple_physics/phyparam/physics/logging.F90

    r4224 r4225  
    2424  END INTERFACE
    2525
    26   ! This module provides a default implementation of flush_plugin but the top-level driver is welcome to override it. 
     26#ifdef XCODEML
     27  ! XCodeML cannot parse procedure pointers                                                                                                                                             
     28
     29#define default_flush_plugin flush_plugin
     30#define default_log_gridpoint log_gridpoint_plugin
     31
     32#else
     33
     34  ! This module provides a default implementation of flush_plugin but the top-level driver is welcome to override it.                                                                   
    2735  PROCEDURE(plugin), POINTER :: flush_plugin => default_flush_plugin
    2836
    29   ! The top-level driver MUST provide an implementation for log_gridpoint_plugin
     37  ! The top-level driver MUST provide an implementation for log_gridpoint_plugin                                                                                                         
    3038  PROCEDURE(plugin_log_gridpoint), POINTER :: log_gridpoint_plugin => NULL()
     39
     40#endif
    3141
    3242  INTEGER, PARAMETER :: linesize=10000, logging_bufsize=100
     
    6979  END SUBROUTINE log_gridpoint
    7080
     81  SUBROUTINE default_log_gridpoint(index, line)
     82    INTEGER, INTENT(IN) :: index ! index of gridpoint                                                                                                                                   
     83    CHARACTER(*), INTENT(OUT) :: line
     84    line=''
     85  END SUBROUTINE default_log_gridpoint
     86
    7187END MODULE logging
  • dynamico_lmdz/simple_physics/phyparam/physics/turbulence.F90

    r4210 r4225  
    248248    IF(lwrite) THEN
    249249       ig=ngrid/2+1
    250        WRITELOG(*,*) 'Pression (mbar) ,altitude (km),u,v,theta, rho dz'
     250       WRITELOG(*,*) 'Pression (mbar) altitude (km),u,v,theta, rho dz'
    251251       DO ilay=1,nlay
    252252          WRITELOG(*,*) .01*pplay(ig,ilay),.001*pzlay(ig,ilay), &
    253253               pu(ig,ilay),pv(ig,ilay),ph(ig,ilay),za(ig,ilay)
    254254       ENDDO
    255        WRITELOG(*,*) 'Pression (mbar) ,altitude (km),zb'
     255       WRITELOG(*,*) 'Pression (mbar) altitude (km),zb'
    256256       DO ilev=1,nlay
    257257          WRITELOG(*,*) .01*pplev(ig,ilev),.001*pzlev(ig,ilev), &
     
    291291       WRITELOG(*,*) 'coefficients Cd pour v et h'
    292292       WRITELOG(*,*) zcdv(ngrid/2+1),zcdh(ngrid/2+1)
    293        WRITELOG(*,*) ,'coefficients K pour v et h'
     293       WRITELOG(*,*) 'coefficients K pour v et h'
    294294       DO ilev=1,nlay
    295295          WRITELOG(*,*) zkv(ngrid/2+1,ilev),zkh(ngrid/2+1,ilev)
     
    429429    IF(lwrite) THEN
    430430       WRITELOG(*,*)
    431        WRITELOG(*,*) ,'Diagnostique de la diffusion verticale'
    432        WRITELOG(*,*) ,'h avant et apres diffusion verticale'
    433        WRITELOG(*,*) ,ptsrf(ngrid/2+1),ztsrf2(ngrid/2+1)
     431       WRITELOG(*,*) 'Diagnostique de la diffusion verticale'
     432       WRITELOG(*,*) 'h avant et apres diffusion verticale'
     433       WRITELOG(*,*) ptsrf(ngrid/2+1),ztsrf2(ngrid/2+1)
    434434       DO  ilev=1,nlay
    435435          WRITELOG(*,*) ph(ngrid/2+1,ilev),zh(ngrid/2+1,ilev)
Note: See TracChangeset for help on using the changeset viewer.