Changeset 4226 for dynamico_lmdz
- Timestamp:
- Jan 10, 2020, 5:15:21 PM (5 years ago)
- Location:
- dynamico_lmdz/simple_physics/phyparam
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
dynamico_lmdz/simple_physics/phyparam/Makefile
r4225 r4226 1 # Examples (bash) : 1 # known to compile with gfortran version 7, ifort version 17, pgfortran version 18 2 # Examples 2 3 # clear ; make clean ; 3 # F90=ifort FFLAGS=-fast time make -j4 # F90=gfortran F90FLAGS=-ffree-line-length-none gmake5 # known to compile with gfortran version 7, ifort version 174 # F90=ifort FFLAGS=-fast make 5 # F90=gfortran F90FLAGS=-ffree-line-length-none make 6 # F90=pgfortran F90FLAGS="-fast -Minfo=loop" make 6 7 7 8 # if XCodeML F_Front is installed, set FFRONT=F_Front to parse code into XML … … 19 20 clean : 20 21 rm -f obj/* include/* lib/* xml/* 22 rmdir obj include lib xml 21 23 22 24 %.so : $(OBJECTS) 23 25 $(F90) -shared $^ -o $@ 24 26 27 obj/read_param_mod.o : logging.o 28 obj/write_field_mod.o : logging.o 25 29 obj/convection.o : logging.o 26 30 obj/surface.o : logging.o -
dynamico_lmdz/simple_physics/phyparam/physics/logging.F90
r4225 r4226 24 24 END INTERFACE 25 25 26 #ifdef XCODEML27 ! XCodeML cannot parse procedure pointers28 26 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. 35 PROCEDURE(plugin), POINTER :: flush_plugin => default_flush_plugin 36 37 ! The top-level driver MUST provide an implementation for log_gridpoint_plugin 27 ! This module provides a default implementations of plugins but the top-level driver is welcome to override them. 28 ! Note F2003/F2008: pgfortran (F2003) accepts to initialize pointers only to NULL() 29 ! => plugins are initialzed to NULL() and set to default values in flush_log and log_gridpoint 30 #ifndef XCODEML 31 ! Note F2003/F2008: XCodeML cannot parse procedure pointers 32 PROCEDURE(plugin), POINTER :: flush_plugin => NULL() 38 33 PROCEDURE(plugin_log_gridpoint), POINTER :: log_gridpoint_plugin => NULL() 39 40 34 #endif 41 35 … … 50 44 51 45 PUBLIC :: logging_buf, logging_bufsize, logging_lineno, flush_log, log_gridpoint, & 52 flush_plugin, log_gridpoint_plugin 46 flush_plugin, log_gridpoint_plugin, default_flush_plugin, & 47 missing_plugin 53 48 54 49 CONTAINS 50 51 SUBROUTINE missing_plugin(name, mod) 52 CHARACTER(*), INTENT(IN) :: name, mod 53 PRINT *, 'FATAL : plugin ', name, ' not provided by the driver program' 54 PRINT *, ' see ', mod 55 STOP 56 END SUBROUTINE missing_plugin 55 57 56 58 SUBROUTINE flush_log(lev,tag) 57 59 INTEGER, INTENT(IN) :: lev 58 60 CHARACTER(*), INTENT(IN) :: tag 61 #ifndef XCODEML 62 IF(.NOT.ASSOCIATED(flush_plugin)) flush_plugin => default_flush_plugin 59 63 IF(logging_lineno>0 .AND. lev<=max_log_level) CALL flush_plugin(lev, TRIM(tag), logging_buf(1:logging_lineno)) 60 64 logging_lineno=0 65 #endif 61 66 END SUBROUTINE flush_log 62 67 … … 76 81 INTEGER, INTENT(IN) :: index 77 82 logging_lineno = logging_lineno+1 83 #ifndef XCODEML 84 IF(.NOT.ASSOCIATED(log_gridpoint_plugin)) log_gridpoint_plugin => default_log_gridpoint 78 85 CALL log_gridpoint_plugin(index, logging_buf(logging_lineno)) 86 #endif 79 87 END SUBROUTINE log_gridpoint 80 88 -
dynamico_lmdz/simple_physics/phyparam/physics/read_param_mod.F90
r4223 r4226 1 1 MODULE read_param_mod 2 USE logging, ONLY : missing_plugin 2 3 IMPLICIT NONE 3 4 PRIVATE … … 31 32 END INTERFACE 32 33 33 PROCEDURE(plugin_read_paramr), POINTER :: read_paramr_plugin => read_paramr_unset 34 PROCEDURE(plugin_read_parami), POINTER :: read_parami_plugin => read_parami_unset 35 PROCEDURE(plugin_read_paramb), POINTER :: read_paramb_plugin => read_paramb_unset 34 #ifndef XCODEML 35 ! Note compiler compatibility : see logging.F90 36 PROCEDURE(plugin_read_paramr), POINTER :: read_paramr_plugin => NULL() 37 PROCEDURE(plugin_read_parami), POINTER :: read_parami_plugin => NULL() 38 PROCEDURE(plugin_read_paramb), POINTER :: read_paramb_plugin => NULL() 39 #endif 36 40 37 41 INTERFACE read_param 38 PROCEDURE read_paramr _plugin, read_parami_plugin, read_paramb_plugin42 PROCEDURE read_paramr, read_parami, read_paramb 39 43 END INTERFACE read_param 40 44 … … 43 47 CONTAINS 44 48 45 SUBROUTINE abort_unset(name) 46 CHARACTER(*), INTENT(IN) :: name 47 PRINT *, 'FATAL : plugin ', name, ' not provided by the driver program' 48 PRINT *, ' see read_param_mod' 49 STOP 50 END SUBROUTINE abort_unset 51 52 SUBROUTINE read_paramr_unset(name, defval, val, comment) 49 SUBROUTINE read_paramr(name, defval, val, comment) 53 50 CHARACTER(*), INTENT(IN) :: name, comment 54 51 REAL, INTENT(IN) :: defval 55 52 REAL, INTENT(OUT) :: val 56 CALL abort_unset('read_paramr') 57 END SUBROUTINE read_paramr_unset 53 #ifndef XCODEML 54 IF(.NOT.ASSOCIATED(read_paramr_plugin)) CALL missing_plugin('read_paramr','read_param_mod') 55 CALL read_paramr_plugin(name, defval, val, comment) 56 #endif 57 END SUBROUTINE read_paramr 58 58 59 SUBROUTINE read_parami _unset(name, defval, val, comment)59 SUBROUTINE read_parami(name, defval, val, comment) 60 60 CHARACTER(*), INTENT(IN) :: name, comment 61 61 INTEGER, INTENT(IN) :: defval 62 62 INTEGER, INTENT(OUT) :: val 63 CALL abort_unset('read_parami') 64 END SUBROUTINE read_parami_unset 63 #ifndef XCODEML 64 IF(.NOT.ASSOCIATED(read_parami_plugin)) CALL missing_plugin('read_parami','read_param_mod') 65 CALL read_parami_plugin(name, defval, val, comment) 66 #endif 67 END SUBROUTINE read_parami 65 68 66 SUBROUTINE read_paramb _unset(name, defval, val, comment)69 SUBROUTINE read_paramb(name, defval, val, comment) 67 70 CHARACTER(*), INTENT(IN) :: name, comment 68 71 LOGICAL, INTENT(IN) :: defval 69 72 LOGICAL, INTENT(OUT) :: val 70 CALL abort_unset('read_paramb') 71 END SUBROUTINE read_paramb_unset 73 #ifndef XCODEML 74 IF(.NOT.ASSOCIATED(read_paramr_plugin)) CALL missing_plugin('read_paramb','read_param_mod') 75 CALL read_paramb_plugin(name, defval, val, comment) 76 #endif 77 END SUBROUTINE read_paramb 72 78 73 79 END MODULE read_param_mod -
dynamico_lmdz/simple_physics/phyparam/physics/writefield_mod.F90
r4223 r4226 1 1 MODULE writefield_mod 2 USE logging, ONLY : missing_plugin 2 3 IMPLICIT NONE 3 4 PRIVATE … … 15 16 END INTERFACE 16 17 17 PROCEDURE(plugin_writefield1), POINTER :: writefield1_plugin => writefield1_unset 18 PROCEDURE(plugin_writefield2), POINTER :: writefield2_plugin => writefield2_unset 19 18 #ifndef XCODEML 19 PROCEDURE(plugin_writefield1), POINTER :: writefield1_plugin => NULL() 20 PROCEDURE(plugin_writefield2), POINTER :: writefield2_plugin => NULL() 21 #endif 20 22 INTERFACE writefield 21 PROCEDURE writefield1 _plugin, writefield2_plugin23 PROCEDURE writefield1, writefield2 22 24 END INTERFACE writefield 23 25 … … 26 28 CONTAINS 27 29 28 SUBROUTINE writefield2 _unset(name, longname, unit, var)30 SUBROUTINE writefield2(name, longname, unit, var) 29 31 CHARACTER(*), INTENT(IN) :: name, longname, unit 30 32 REAL, INTENT(IN) :: var(:,:) 31 PRINT *, 'FATAL : plugin writefield2 not provided by the driver program' 32 PRINT *, ' see writefield.F90' 33 STOP 34 END SUBROUTINE writefield2_unset 33 #ifndef XCODEML 34 IF(ASSOCIATED(writefield2_plugin)) THEN 35 CALL writefield2_plugin(name, longname, unit, var) 36 ELSE 37 CALL missing_plugin('writefield2','writefield_mod') 38 END IF 39 #endif 40 END SUBROUTINE writefield2 35 41 36 SUBROUTINE writefield1 _unset(name, longname, unit, var)42 SUBROUTINE writefield1(name, longname, unit, var) 37 43 CHARACTER(*), INTENT(IN) :: name, longname, unit 38 44 REAL, INTENT(IN) :: var(:) 39 PRINT *, 'FATAL : plugin writefield1 not provided by the driver program' 40 PRINT *, ' see writefield.F90' 41 STOP 42 END SUBROUTINE writefield1_unset 45 #ifndef XCODEML 46 IF(ASSOCIATED(writefield1_plugin)) THEN 47 CALL writefield1_plugin(name, longname, unit, var) 48 ELSE 49 CALL missing_plugin('writefield1','writefield_mod') 50 END IF 51 #endif 52 END SUBROUTINE writefield1 43 53 44 54 END MODULE writefield_mod
Note: See TracChangeset
for help on using the changeset viewer.