From ea4e5188cf8193f45929bfaa05b1b8a68304d007 Mon Sep 17 00:00:00 2001 From: Chris Date: Wed, 20 Aug 2025 13:58:38 +0200 Subject: [PATCH 1/6] attempt to update make for newer python --- Utilities/python_wrapper/CMakeLists.txt | 221 ++++++++++-------------- pyproject.toml | 67 +++++++ setup.py | 55 ------ 3 files changed, 155 insertions(+), 188 deletions(-) create mode 100644 pyproject.toml delete mode 100644 setup.py diff --git a/Utilities/python_wrapper/CMakeLists.txt b/Utilities/python_wrapper/CMakeLists.txt index 96658fe1..ac29e85e 100644 --- a/Utilities/python_wrapper/CMakeLists.txt +++ b/Utilities/python_wrapper/CMakeLists.txt @@ -1,152 +1,107 @@ -list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake) -find_package(PythonExtensions REQUIRED) -find_package(NumPy REQUIRED) -find_package(F2PY REQUIRED) -find_package(F90Wrap REQUIRED) - -# Fortran preprocessing compiler -if(CMAKE_Fortran_COMPILER_ID STREQUAL Intel) - set(FPP_COMPILER fpp) - set(FPP_COMPILE_FLAGS "") -else() - set(FPP_COMPILER ${CMAKE_Fortran_COMPILER}) - set(FPP_COMPILE_FLAGS -E -cpp) -endif() +# Load Python and various components +find_package(Python 3.10 REQUIRED + COMPONENTS Interpreter Development.Module NumPy +) -get_directory_property(COMP_DEFS COMPILE_DEFINITIONS) -message(STATUS "Compile definitions for preprocessor are ${COMP_DEFS}") -string(REPLACE ";" " " COMP_DEF_STR "${COMPILE_DEFINITIONS}") - -function(preprocess_fortran outvar) - message(STATUS "preprocess_fortran arguments: ${outvar}, followed by ${ARGN}") - set(srcs) - foreach(f ${ARGN}) - # is it a Fortran file? - if(f MATCHES "\\.[Ff](9[05])?") - message(STATUS "Got fortran file: ${f}") - # construct output filename - if(NOT IS_ABSOLUTE "${f}") - get_filename_component(f "${f}" ABSOLUTE) - endif() - file(RELATIVE_PATH r "${CMAKE_CURRENT_SOURCE_DIR}" "${f}") - get_filename_component(e "${r}" EXT) - get_filename_component(n "${r}" NAME_WE) - get_filename_component(p "${r}" PATH) - set(of "${CMAKE_CURRENT_BINARY_DIR}/${n}_fpp${e}") - message(STATUS "Output name: ${of}") - # preprocess the thing - if (CMAKE_Fortran_COMPILER_ID STREQUAL Intel) - add_custom_command(OUTPUT "${of}" - COMMAND ${FPP_COMPILER} ${FPP_COMPILE_FLAGS} ${COMP_DEF_STR} "${f}" "${of}" - IMPLICIT_DEPENDS Fortran "${f}" - COMMENT "Preprocessing ${f}" - VERBATIM - ) - else() - add_custom_command(OUTPUT "${of}" - COMMAND ${FPP_COMPILER} ${FPP_COMPILE_FLAGS} ${COMP_DEF_STR} "${f}" -o "${of}" - IMPLICIT_DEPENDS Fortran "${f}" - COMMENT "Preprocessing ${f}" - VERBATIM - ) - endif() - list(APPEND srcs "${of}") - #else() - # list(APPEND srcs "${f}") - endif() - endforeach() - # return the (preprocessed) sources - set(${outvar} "${srcs}" PARENT_SCOPE) -endfunction() +# Get the path of the `f2py` include directory that will be needed for the library compilation +execute_process( + COMMAND "${Python_EXECUTABLE}" -c "import numpy.f2py; print(numpy.f2py.get_include())" + OUTPUT_VARIABLE F2PY_INCLUDE_DIR + OUTPUT_STRIP_TRAILING_WHITESPACE +) +message(STATUS "f2py res" ${F2PY_INCLUDE_DIR} +) -#message(STATUS "fortran_src_files is ${fortran_src_files}") -preprocess_fortran(fpp_files ${fortran_src_files}) -#message(STATUS "fpp_files is ${fpp_files}") +# Create the list of Fortran files to include in the Python module +set(spec4py_f90_src_files ${fortran_src_files}) -# ---------------------------------------------------------------------------- -# NOTE: There is no way to identify the f90wrap---.f90 files ahead of running f90wrap -# NOTE: The files produced have no one->one relation with the source files. -# NOTE: So giving the names of f90wrap_---.f90 files manually -#----------------------------------------------------------------------------- -set(f90wrap_output_files ${CMAKE_CURRENT_BINARY_DIR}/f90wrap_global_m_fpp.f90 - ${CMAKE_CURRENT_BINARY_DIR}/f90wrap_inputlist_m_fpp.f90 - ${CMAKE_CURRENT_BINARY_DIR}/f90wrap_intghs_m_fpp.f90 - ${CMAKE_CURRENT_BINARY_DIR}/f90wrap_msphdf5_m_fpp.f90 - ${CMAKE_CURRENT_BINARY_DIR}/f90wrap_newton_m_fpp.f90 +set(f90wrap_output_files ${CMAKE_CURRENT_BINARY_DIR}/f90wrap_global_m.f90 + ${CMAKE_CURRENT_BINARY_DIR}/f90wrap_inputlist_m.f90 + ${CMAKE_CURRENT_BINARY_DIR}/f90wrap_intghs_m.f90 + ${CMAKE_CURRENT_BINARY_DIR}/f90wrap_msphdf5_m.f90 + ${CMAKE_CURRENT_BINARY_DIR}/f90wrap_newton_m.f90 ${CMAKE_CURRENT_BINARY_DIR}/f90wrap_toplevel.f90 ) -set(kind_map_file ${CMAKE_CURRENT_SOURCE_DIR}/kind_map) -set(python_mod_name spec_f90wrapped) -set(python_mod_file ${CMAKE_CURRENT_BINARY_DIR}/${python_mod_name}.py) +# Before using `f90wrap`, we need to preprocess the Fortran files because `f90wrap` will otherwise ignore some directives. +# Since there is no way of generalizing the preprocessing, we need to define the correct flags for each compiler. +if(CMAKE_Fortran_COMPILER_ID STREQUAL "GNU") + set(PP_FLAG "-cpp") + set(PP_ONLY_FLAG "-E") +elseif(CMAKE_Fortran_COMPILER_ID MATCHES "Intel") + set(PP_FLAG "-fpp") + set(PP_ONLY_FLAG "-E") +elseif(CMAKE_Fortran_COMPILER_ID MATCHES "NVHPC|PGI") + set(PP_FLAG "-Mpreprocess") + set(PP_ONLY_FLAG "-E") +else() + message(ERROR "Unknown Fortran compiler: preprocessing may not work") +endif() -add_custom_target(preprocessing ALL - DEPENDS ${fpp_files} +# TODO: Add the preprocessing options +message(WARNING "Make sure all options are accounted for in the preprocessing step") +foreach(src_file ${spec4py_f90_src_files}) + get_filename_component(basename "${src_file}" NAME_WE) + set(pp_file "${CMAKE_CURRENT_BINARY_DIR}/${basename}.i90") + list(APPEND spec4py_f90_pp_files "${pp_file}") + add_custom_command( + COMMAND ${CMAKE_Fortran_COMPILER} ${PP_FLAG} ${PP_ONLY_FLAG} ${src_file} + -o ${pp_file} + DEPENDS ${src_file} + OUTPUT ${pp_file} + COMMENT "Preprocess ${src_file}" + ) +endforeach() + +# Create the list of f90wrap output files +# We need to define those filenames to use dependency between the `f90wrap` and `f2py` custom commands. +foreach(file ${spec4py_f90_pp_files}) + get_filename_component(basename "${file}" NAME_WE) + list(APPEND spec4py_wrap_files "f90wrap_${basename}.f90") +endforeach() + +list(TRANSFORM spec4py_wrap_files PREPEND "${CMAKE_CURRENT_BINARY_DIR}/") + +add_custom_target( + f90wrap_SPEC + DEPENDS ${spec4py_wrap_files} ) -add_custom_command(OUTPUT ${python_mod_file} ${f90wrap_output_files} - COMMAND "${F90Wrap_EXECUTABLE}" -m "${python_mod_name}" ${fpp_files} -k "${kind_map_file}" - #IMPLICIT_DEPENDS Fortran ${fpp_files} - DEPENDS ${fpp_files} ${kind_map_file} - COMMENT "Executing F90Wrap for" ${fpp_files} +set(f90wrap_module_name "spec4py") +add_custom_command( + COMMAND "${Python_EXECUTABLE}" + -m f90wrap + ${spec4py_f90_pp_files} + --mod-name "${f90wrap_module_name}" + --kind-map "${CMAKE_CURRENT_SOURCE_DIR}/kind_map" + DEPENDS ${spec4py_f90_pp_files} + OUTPUT ${spec4py_wrap_files} + COMMENT "Generate Fortran interfaces using `f90wrap`" VERBATIM ) -#add_custom_target("${python_mod_name}_pymod" -# DEPENDS ${python_mod_file} ${f90wrap_output_files} -#) - -set(f2py_module_name "_${python_mod_name}") -set(generated_module_file ${CMAKE_CURRENT_BINARY_DIR}/${f2py_module_name}${PYTHON_EXTENSION_MODULE_SUFFIX}) -message(STATUS "Python exten suffix expansion: ${PYTHON_EXTENSION_MODULE_SUFFIX}") -message(STATUS "f90_wrap_output_files: " ${f90wrap_output_files}) -message(STATUS "f2py_module_name: ${f2py_module_name}") -message(STATUS "generated_module_name: ${generated_module_file}") - -include_directories("${NumPy_INCLUDE_DIRS}" "${F2PY_INCLUDE_DIRS}" "${CMAKE_CURRENT_BINARY_DIR}") -add_custom_target(${f2py_module_name} ALL - DEPENDS ${generated_module_file} spec ${f90wrap_output_files} -) - +set(f2py_module_name "_${f90wrap_module_name}") add_custom_command( - OUTPUT ${generated_module_file} - COMMAND ${F2PY_EXECUTABLE} - -m ${f2py_module_name} - --build-dir ${CMAKE_CURRENT_BINARY_DIR} - --f90exec=${CMAKE_Fortran_COMPILER} - --f77exec=${CMAKE_Fortran_COMPILER} - --f90flags="-fopenmp" - -lgomp - -c - #${SCALAPACK_LIB} ${NETCDF_F} ${NETCDF_C} - ${f90wrap_output_files} - -I${CMAKE_BINARY_DIR}/build/modules/spec_modules - -I${HDF5_Fortran_INCLUDE_DIRS} - --verbose - ${CMAKE_BINARY_DIR}/build/lib/libspec.a - ${SPEC_LINK_LIB} - #IMPLICIT_DEPENDS Fortran ${f90wrap_output_files} - DEPENDS spec ${f90wrap_output_files} - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} - #VERBATIM - COMMAND_EXPAND_LISTS + COMMAND f2py-f90wrap + -m "${f2py_module_name}" + --lower + ${f90wrap_output_files} + DEPENDS ${spec4py_wrap_files} ${spec4py_f90_pp_files} + OUTPUT "${f2py_module_name}module.c" + COMMENT "Generate C interfaces for Python using `f2py`" + VERBATIM ) -python_extension_module(${generated_module_file}) -install(FILES ${python_mod_file} ${generated_module_file} #${CMAKE_CURRENT_SOURCE_DIR}/__init__.py - DESTINATION Utilities/python_wrapper/spec +Python_add_library("${f2py_module_name}" MODULE WITH_SOABI + "${f2py_module_name}module.c" + "${F2PY_INCLUDE_DIR}/fortranobject.c" + "${spec4py_wrap_files}" ) -#set(PYINIT_STR "import sys\nimport os.path\nsys.path.append(os.path.dirname(__file__))\n\nfrom .spec import *\n") -#set(PYINIT_FILE ${CMAKE_CURRENT_BINARY_DIR}/__init__.py) -#FILE(WRITE ${PYINIT_FILE} ${PYINIT_STR}) -#install(FILES ${python_mod_file} ${generated_module_file} ${PYINIT_FILE} -# DESTINATION spec # Here spec is directory location -#) -#install(TARGETS xspec spec) -# LIBRARY DESTINATION ${CMAKE_INSTALL_DIR}/. -# RUNTIME DESTINATION bin -#) - +target_include_directories("${f2py_module_name}" PRIVATE ${F2PY_INCLUDE_DIR} ${Python_NumPy_INCLUDE_DIRS} ${Python_INCLUDE_DIRS} ${CMAKE_BINARY_DIR}/src) +target_link_libraries("${f2py_module_name}" PRIVATE Python::NumPy spec_f90) +add_dependencies("${f2py_module_name}" f90wrap_SPEC) +install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${f90wrap_module_name}.py" DESTINATION .) +install(TARGETS "${f2py_module_name}" LIBRARY DESTINATION .) diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..3be479d0 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,67 @@ +[build-system] +requires = [ + "scikit-build-core>=0.8.0", + "numpy>=2.2", + "f90wrap", + "meson;python_version>='3.12'", + "ninja" +] +build-backend = "scikit_build_core.build" + +[project] +name = "spec" +version = "0.0.3" +description = "Stepped Pressure Equilibrium Code MHD Equilibrium Solver" +authors = [ + {name = "Christopher Berg Smiet", email = "christopher.smiet@epfl.ch"}, + {name = "Stuart R. Hudson"}, + {name = "Joaquim Loizu", email = "joaquim.loizu@epfl.ch"}, + {name = "Bharat Medasani", email = "mbkumar@gmail.com"}, + {name = "Caoxiang Zhu"} +] +readme = "README.md" +license = {file = "LICENSE"} +requires-python = ">=3.8" +classifiers = [ + "Development Status :: 4 - Beta", + "Intended Audience :: Science/Research", + "License :: OSI Approved :: GPL-3.0 License", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Topic :: Scientific/Engineering :: Physics", +] +dependencies = [ + "numpy>=1.23.5", + "f90wrap", +] + + +[project.urls] +Homepage = "https://github.com/PrincetonUniversity/SPEC" +Documentation = "https://princetonuniversity.github.io/SPEC/" +Repository = "https://github.com/PrincetonUniversity/SPEC.git" +"Bug Tracker" = "https://github.com/PrincetonUniversity/SPEC/issues" + +[tool.scikit-build] +# Specify the CMake source directory +cmake.source-dir = "." +# Set minimum CMake version +cmake.version = ">=3.15" +# Build directory +build-dir = "build/{wheel_tag}" +# Configure install components +install.components = ["python_wrapper"] +# Ensure wheel includes the Python wrapper package +wheel.packages = ["spec"] + +[tool.scikit-build.cmake.define] +# Ensure SKBUILD is defined for conditional Python wrapper building +SKBUILD = "ON" +# Set compilers and BLAS vendor from cmake_config.json +CMAKE_C_COMPILER = {env="CMAKE_ARGS_CMAKE_C_COMPILER", default="mpicc"} +CMAKE_Fortran_COMPILER = {env="CMAKE_ARGS_CMAKE_Fortran_COMPILER", default="mpif90"} +BLA_VENDOR = {env="CMAKE_ARGS_BLA_VENDOR", default="OpenBLAS"} diff --git a/setup.py b/setup.py deleted file mode 100644 index e0ac7fad..00000000 --- a/setup.py +++ /dev/null @@ -1,55 +0,0 @@ -#!/usr/bin/env python3 - -import os # environ -import sys -import json -import argparse -import setuptools - -from os.path import basename, splitext -from glob import glob -import numpy - -print("system.platform is {}".format(sys.platform)) -if (sys.platform == "darwin"): - from distutils import sysconfig - vars = sysconfig.get_config_vars() - vars['LDSHARED'] = vars['LDSHARED'].replace('-bundle', '-dynamiclib') - -from setuptools import find_packages -from skbuild import setup - -# Load machine-specific options from cmake_config.json. -# It should contain a dict with an array called cmake_args. -with open('cmake_config.json') as fp: - d = json.load(fp) - -# Include additional parameters from CMAKE_ARGS environment variable. -# This is the way Anaconda tells CMake its specific needs. -if 'CMAKE_ARGS' in os.environ: - - print("CMAKE_ARGS = '%s'"%(os.environ['CMAKE_ARGS'])) - for cmake_arg in os.environ['CMAKE_ARGS'].split(" "): - d['cmake_args'].append(cmake_arg) - -# Tell CMake about where to find numpy libraries -# see also: https://stackoverflow.com/a/14657667 -d['cmake_args'].append("-DCMAKE_C_FLAGS=-I"+numpy.get_include()) - -setup( - name="spec", - version="0.0.3", - #license="MIT", - packages=['spec'], - package_dir={'': 'Utilities/python_wrapper'}, - #py_modules=[splitext(basename(path))[0] for path in glob('src/vmec/*.py')], - install_requires=['f90wrap', 'scikit-build'], - classifiers=[ - "Development Status :: 1 - Alpha", - "Intended Audience :: Nuclear Fusion Community", - "License :: OSI Approved :: MIT License", - "Programming Language :: Python", - "Programming Language :: Python :: 3", - "Topic :: MHD Equilibrium Solver"], - cmake_args=d['cmake_args'], -) From 89841b1e1b3cbdb34a971806b45f67ee6cef7602 Mon Sep 17 00:00:00 2001 From: Chris Date: Wed, 20 Aug 2025 14:00:25 +0200 Subject: [PATCH 2/6] revert little change --- Utilities/python_wrapper/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Utilities/python_wrapper/CMakeLists.txt b/Utilities/python_wrapper/CMakeLists.txt index ac29e85e..dc480a9f 100644 --- a/Utilities/python_wrapper/CMakeLists.txt +++ b/Utilities/python_wrapper/CMakeLists.txt @@ -86,8 +86,8 @@ add_custom_command( COMMAND f2py-f90wrap -m "${f2py_module_name}" --lower - ${f90wrap_output_files} - DEPENDS ${spec4py_wrap_files} ${spec4py_f90_pp_files} + ${spec4py_wrap_files} + DEPENDS ${spec4py_wrap_files} OUTPUT "${f2py_module_name}module.c" COMMENT "Generate C interfaces for Python using `f2py`" VERBATIM From 63bdb552b22e9dc9ebd9add72c4d1afafd40661d Mon Sep 17 00:00:00 2001 From: Chris Date: Wed, 20 Aug 2025 14:34:51 +0200 Subject: [PATCH 3/6] use only wrapper-generated files --- Utilities/python_wrapper/CMakeLists.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Utilities/python_wrapper/CMakeLists.txt b/Utilities/python_wrapper/CMakeLists.txt index dc480a9f..38b3c31b 100644 --- a/Utilities/python_wrapper/CMakeLists.txt +++ b/Utilities/python_wrapper/CMakeLists.txt @@ -75,6 +75,7 @@ add_custom_command( ${spec4py_f90_pp_files} --mod-name "${f90wrap_module_name}" --kind-map "${CMAKE_CURRENT_SOURCE_DIR}/kind_map" + --package DEPENDS ${spec4py_f90_pp_files} OUTPUT ${spec4py_wrap_files} COMMENT "Generate Fortran interfaces using `f90wrap`" @@ -86,7 +87,7 @@ add_custom_command( COMMAND f2py-f90wrap -m "${f2py_module_name}" --lower - ${spec4py_wrap_files} + ${f90wrap_output_files} DEPENDS ${spec4py_wrap_files} OUTPUT "${f2py_module_name}module.c" COMMENT "Generate C interfaces for Python using `f2py`" @@ -96,7 +97,7 @@ add_custom_command( Python_add_library("${f2py_module_name}" MODULE WITH_SOABI "${f2py_module_name}module.c" "${F2PY_INCLUDE_DIR}/fortranobject.c" - "${spec4py_wrap_files}" + "${f90wrap_output_files}" ) target_include_directories("${f2py_module_name}" PRIVATE ${F2PY_INCLUDE_DIR} ${Python_NumPy_INCLUDE_DIRS} ${Python_INCLUDE_DIRS} ${CMAKE_BINARY_DIR}/src) From 9deab7c5d83b5ad88344c2465f80de7c3073cd0d Mon Sep 17 00:00:00 2001 From: Chris Date: Mon, 2 Mar 2026 16:29:31 +0100 Subject: [PATCH 4/6] fix build with toml and proper f90wrap intermediate file handling --- Utilities/python_wrapper/CMakeLists.txt | 182 ++++++++++++++++++------ pyproject.toml | 4 +- src/CMakeLists.txt | 2 +- 3 files changed, 139 insertions(+), 49 deletions(-) diff --git a/Utilities/python_wrapper/CMakeLists.txt b/Utilities/python_wrapper/CMakeLists.txt index 38b3c31b..eeb738b8 100644 --- a/Utilities/python_wrapper/CMakeLists.txt +++ b/Utilities/python_wrapper/CMakeLists.txt @@ -1,31 +1,30 @@ +# ============================================================================= +# Python wrapper for SPEC using f90wrap and f2py +# ============================================================================= + # Load Python and various components find_package(Python 3.10 REQUIRED COMPONENTS Interpreter Development.Module NumPy ) - # Get the path of the `f2py` include directory that will be needed for the library compilation execute_process( COMMAND "${Python_EXECUTABLE}" -c "import numpy.f2py; print(numpy.f2py.get_include())" OUTPUT_VARIABLE F2PY_INCLUDE_DIR OUTPUT_STRIP_TRAILING_WHITESPACE ) -message(STATUS "f2py res" ${F2PY_INCLUDE_DIR} -) +message(STATUS "f2py include dir: ${F2PY_INCLUDE_DIR}") # Create the list of Fortran files to include in the Python module +# These come from src/CMakeLists.txt via fortran_src_files variable set(spec4py_f90_src_files ${fortran_src_files}) +message(STATUS "Fortran source files for Python wrapper: ${spec4py_f90_src_files}") -set(f90wrap_output_files ${CMAKE_CURRENT_BINARY_DIR}/f90wrap_global_m.f90 - ${CMAKE_CURRENT_BINARY_DIR}/f90wrap_inputlist_m.f90 - ${CMAKE_CURRENT_BINARY_DIR}/f90wrap_intghs_m.f90 - ${CMAKE_CURRENT_BINARY_DIR}/f90wrap_msphdf5_m.f90 - ${CMAKE_CURRENT_BINARY_DIR}/f90wrap_newton_m.f90 - ${CMAKE_CURRENT_BINARY_DIR}/f90wrap_toplevel.f90 -) +# ============================================================================= +# Step 1: Preprocess Fortran files using the Fortran compiler preprocessor +# ============================================================================= -# Before using `f90wrap`, we need to preprocess the Fortran files because `f90wrap` will otherwise ignore some directives. -# Since there is no way of generalizing the preprocessing, we need to define the correct flags for each compiler. +# Set preprocessor flags for each compiler if(CMAKE_Fortran_COMPILER_ID STREQUAL "GNU") set(PP_FLAG "-cpp") set(PP_ONLY_FLAG "-E") @@ -36,73 +35,164 @@ elseif(CMAKE_Fortran_COMPILER_ID MATCHES "NVHPC|PGI") set(PP_FLAG "-Mpreprocess") set(PP_ONLY_FLAG "-E") else() - message(ERROR "Unknown Fortran compiler: preprocessing may not work") + message(WARNING "Unknown Fortran compiler: preprocessing may not work") + set(PP_FLAG "-cpp") + set(PP_ONLY_FLAG "-E") endif() -# TODO: Add the preprocessing options -message(WARNING "Make sure all options are accounted for in the preprocessing step") +# Preprocess each Fortran source file foreach(src_file ${spec4py_f90_src_files}) get_filename_component(basename "${src_file}" NAME_WE) - set(pp_file "${CMAKE_CURRENT_BINARY_DIR}/${basename}.i90") + set(pp_file "${CMAKE_CURRENT_BINARY_DIR}/${basename}_fpp.F90") list(APPEND spec4py_f90_pp_files "${pp_file}") add_custom_command( COMMAND ${CMAKE_Fortran_COMPILER} ${PP_FLAG} ${PP_ONLY_FLAG} ${src_file} -o ${pp_file} DEPENDS ${src_file} OUTPUT ${pp_file} - COMMENT "Preprocess ${src_file}" + COMMENT "Preprocess ${src_file} -> ${basename}_fpp.F90" ) endforeach() -# Create the list of f90wrap output files -# We need to define those filenames to use dependency between the `f90wrap` and `f2py` custom commands. -foreach(file ${spec4py_f90_pp_files}) - get_filename_component(basename "${file}" NAME_WE) - list(APPEND spec4py_wrap_files "f90wrap_${basename}.f90") -endforeach() +message(STATUS "Preprocessed files: ${spec4py_f90_pp_files}") -list(TRANSFORM spec4py_wrap_files PREPEND "${CMAKE_CURRENT_BINARY_DIR}/") +# ============================================================================= +# Step 2: Run f90wrap to generate Fortran wrapper files +# ============================================================================= -add_custom_target( - f90wrap_SPEC - DEPENDS ${spec4py_wrap_files} +# f90wrap generates wrapper files only for modules that have wrappable content. +# These are the known output files based on the SPEC source structure. +# f90wrap_toplevel.f90 contains the standalone subroutines. +set(f90wrap_output_files + ${CMAKE_CURRENT_BINARY_DIR}/f90wrap_global_m_fpp.f90 + ${CMAKE_CURRENT_BINARY_DIR}/f90wrap_inputlist_m_fpp.f90 + ${CMAKE_CURRENT_BINARY_DIR}/f90wrap_intghs_m_fpp.f90 + ${CMAKE_CURRENT_BINARY_DIR}/f90wrap_msphdf5_m_fpp.f90 + ${CMAKE_CURRENT_BINARY_DIR}/f90wrap_newton_m_fpp.f90 + ${CMAKE_CURRENT_BINARY_DIR}/f90wrap_toplevel.f90 ) -set(f90wrap_module_name "spec4py") +# The module name must be "spec_f90wrapped" to be compatible with simsopt +# which imports "spec.spec_f90wrapped" +set(f90wrap_module_name "spec_f90wrapped") +set(f90wrap_python_file "${CMAKE_CURRENT_BINARY_DIR}/${f90wrap_module_name}.py") + add_custom_command( COMMAND "${Python_EXECUTABLE}" - -m f90wrap - ${spec4py_f90_pp_files} - --mod-name "${f90wrap_module_name}" - --kind-map "${CMAKE_CURRENT_SOURCE_DIR}/kind_map" - --package + -m f90wrap + ${spec4py_f90_pp_files} + --mod-name "${f90wrap_module_name}" + --kind-map "${CMAKE_CURRENT_SOURCE_DIR}/kind_map" + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} DEPENDS ${spec4py_f90_pp_files} - OUTPUT ${spec4py_wrap_files} - COMMENT "Generate Fortran interfaces using `f90wrap`" + OUTPUT ${f90wrap_output_files} ${f90wrap_python_file} + COMMENT "Generate Fortran interfaces using f90wrap" VERBATIM ) +add_custom_target( + f90wrap_SPEC + DEPENDS ${f90wrap_output_files} ${f90wrap_python_file} +) + +# ============================================================================= +# Step 3: Run f2py-f90wrap to generate C interface code +# ============================================================================= + set(f2py_module_name "_${f90wrap_module_name}") +set(f2py_c_file "${CMAKE_CURRENT_BINARY_DIR}/${f2py_module_name}module.c") + add_custom_command( COMMAND f2py-f90wrap -m "${f2py_module_name}" --lower ${f90wrap_output_files} - DEPENDS ${spec4py_wrap_files} - OUTPUT "${f2py_module_name}module.c" - COMMENT "Generate C interfaces for Python using `f2py`" + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + DEPENDS ${f90wrap_output_files} + OUTPUT ${f2py_c_file} + COMMENT "Generate C interfaces for Python using f2py-f90wrap" VERBATIM ) -Python_add_library("${f2py_module_name}" MODULE WITH_SOABI - "${f2py_module_name}module.c" +add_custom_target( + f2py_SPEC + DEPENDS ${f2py_c_file} +) + +# ============================================================================= +# Step 4: Build the Python extension module +# ============================================================================= + +# Create the shared library using the generated files +add_library("${f2py_module_name}" MODULE + ${f2py_c_file} "${F2PY_INCLUDE_DIR}/fortranobject.c" - "${f90wrap_output_files}" + ${f90wrap_output_files} +) + +# Set the library properties for Python extension +set_target_properties("${f2py_module_name}" PROPERTIES + PREFIX "" + SUFFIX ".${Python_SOABI}.so" + C_VISIBILITY_PRESET hidden + Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/modules +) + +# Tell CMake that the source files are generated +set_source_files_properties( + ${f2py_c_file} + ${f90wrap_output_files} + PROPERTIES GENERATED TRUE +) + +target_include_directories("${f2py_module_name}" PRIVATE + ${F2PY_INCLUDE_DIR} + ${Python_NumPy_INCLUDE_DIRS} + ${Python_INCLUDE_DIRS} + ${CMAKE_BINARY_DIR}/src + ${CMAKE_Fortran_MODULE_DIRECTORY}/spec_modules +) + +# Compile options for the wrapper Fortran files +target_compile_options("${f2py_module_name}" PRIVATE + $<$:-cpp> + $<$,$>:-ffree-line-length-none> + $<$,$>:-fdefault-real-8> + $<$,$>:-fPIC> ) -target_include_directories("${f2py_module_name}" PRIVATE ${F2PY_INCLUDE_DIR} ${Python_NumPy_INCLUDE_DIRS} ${Python_INCLUDE_DIRS} ${CMAKE_BINARY_DIR}/src) -target_link_libraries("${f2py_module_name}" PRIVATE Python::NumPy spec_f90) -add_dependencies("${f2py_module_name}" f90wrap_SPEC) +target_link_libraries("${f2py_module_name}" PRIVATE + Python::NumPy + spec + ${SPEC_LINK_LIB} +) + +# Ensure proper build order +add_dependencies("${f2py_module_name}" f90wrap_SPEC f2py_SPEC spec) + +# ============================================================================= +# Step 5: Installation +# ============================================================================= -install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${f90wrap_module_name}.py" DESTINATION .) -install(TARGETS "${f2py_module_name}" LIBRARY DESTINATION .) +# The package name is "spec" and the wrapper module inside is "spec_f90wrapped" +# This matches what simsopt expects: "import spec.spec_f90wrapped" +set(spec_package_name "spec") + +# Install the existing spec package files from the source directory +install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/spec/" + DESTINATION "${spec_package_name}" + COMPONENT python_wrapper + FILES_MATCHING PATTERN "*.py" +) + +# Install the generated Python wrapper file (spec_f90wrapped.py) +install(FILES "${f90wrap_python_file}" + DESTINATION "${spec_package_name}" + COMPONENT python_wrapper +) + +# Install the shared library into the spec package +install(TARGETS "${f2py_module_name}" + LIBRARY DESTINATION "${spec_package_name}" + COMPONENT python_wrapper +) diff --git a/pyproject.toml b/pyproject.toml index 3be479d0..885ca1e4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,7 +2,7 @@ requires = [ "scikit-build-core>=0.8.0", "numpy>=2.2", - "f90wrap", + "f90wrap<0.3", "meson;python_version>='3.12'", "ninja" ] @@ -36,7 +36,7 @@ classifiers = [ ] dependencies = [ "numpy>=1.23.5", - "f90wrap", + "f90wrap<0.3", ] diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 387457d8..799e82e1 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -222,7 +222,7 @@ target_compile_options(spec $<$:-ffree-line-length-none> $<$:-fdefault-real-8> $<$:-fbounds-check> - #$<$:-std=legacy> + $<$:-std=legacy> $<$:-fexternal-blas> $<$:-r8> ) From 553979f1ec8764480f5a1d7e2a614fbb05a9b106 Mon Sep 17 00:00:00 2001 From: Chris Date: Mon, 2 Mar 2026 16:30:11 +0100 Subject: [PATCH 5/6] fix strings that modern compilation linking caused to fail --- src/bfield.f90 | 4 ++-- src/bnorml.f90 | 2 +- src/brcast.f90 | 2 +- src/casing.f90 | 4 ++-- src/curent.f90 | 4 ++-- src/dforce.f90 | 24 ++++++++++++------------ src/dfp200.f90 | 28 ++++++++++++++-------------- src/global.f90 | 34 +++++++++++++++++----------------- src/hesian.f90 | 46 +++++++++++++++++++++++----------------------- src/jo00aa.f90 | 14 +++++++------- src/lforce.f90 | 4 ++-- src/ma02aa.f90 | 16 ++++++++-------- src/matrix.f90 | 4 ++-- src/mp00ac.f90 | 10 +++++----- src/newton.f90 | 28 ++++++++++++++-------------- src/packab.f90 | 2 +- src/pc00aa.f90 | 6 +++--- src/pc00ab.f90 | 2 +- src/pp00ab.f90 | 2 +- src/preset.f90 | 36 ++++++++++++++++++------------------ src/tr00ab.f90 | 16 ++++++++-------- src/volume.f90 | 4 ++-- src/wa00aa.f90 | 28 ++++++++++++++-------------- src/xspech.f90 | 22 +++++++++++----------- 24 files changed, 171 insertions(+), 171 deletions(-) diff --git a/src/bfield.f90 b/src/bfield.f90 index 5c2daa8c..6370acc4 100644 --- a/src/bfield.f90 +++ b/src/bfield.f90 @@ -163,7 +163,7 @@ subroutine bfield( zeta, st, Bst ) cput = GETTIME - write(ounit,'("bfield : ",f10.2," : lvol=",i3," ; zeta="es23.15" ; (s,t)=("es23.15" ,"es23.15" ) ; B^z="es23.15" ;")') & + write(ounit,'("bfield : ",f10.2," : lvol=",i3," ; zeta=",es23.15," ; (s,t)=("es23.15" ,"es23.15" ) ; B^z=",es23.15," ;")') & cput-cpus, lvol, zeta, st(1:2), dBu(3) FATAL( bfield, abs(dBu(3)).lt.vsmall, field is not toroidal ) @@ -328,7 +328,7 @@ subroutine bfield_tangent( zeta, st, Bst ) cput = GETTIME - write(ounit,'("bfield : ",f10.2," : lvol=",i3," ; zeta="es23.15" ; (s,t)=("es23.15" ,"es23.15" ) ; B^z="es23.15" ;")') & + write(ounit,'("bfield : ",f10.2," : lvol=",i3," ; zeta=",es23.15," ; (s,t)=("es23.15" ,"es23.15" ) ; B^z=",es23.15," ;")') & cput-cpus, lvol, zeta, st(1:2), gBzeta FATAL( bfield, abs(gBzeta).lt.vsmall, field is not toroidal ) diff --git a/src/bnorml.f90 b/src/bnorml.f90 index 4aaffbc1..293e0049 100644 --- a/src/bnorml.f90 +++ b/src/bnorml.f90 @@ -282,7 +282,7 @@ subroutine bnorml( mn, Ntz, efmn, ofmn ) endif ! end of if (Lvcgrid ) !-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-! -1001 format("bnorml : ", 10x ," : "a1" : (t,z) = ("f8.4","f8.4" ) ; gBn=",f23.15," ; ":" error =",f23.15" ;") +1001 format("bnorml : ", 10x ," : "a1," : (t,z) = ("f8.4","f8.4" ) ; gBn=",f23.15," ; ":" error =",f23.15," ;") !-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-! diff --git a/src/brcast.f90 b/src/brcast.f90 index 0fc94027..a32105ac 100644 --- a/src/brcast.f90 +++ b/src/brcast.f90 @@ -144,7 +144,7 @@ subroutine brcast( lvol ) ! if( lvol.gt.Nvol .and. Lconstraint.eq.-1 .and. Wcurent ) then ! 27 Feb 17; if( lvol.gt.Nvol .and. Wcurent ) then ! 27 Feb 17; - !write(ounit,'("brcast : " 10x " : myid="i3" ; broadcasting : curtor="es13.5" ; curpol="es13.5" ;")') myid, curtor, curpol + !write(ounit,'("brcast : " 10x " : myid=",i3," ; broadcasting : curtor=",es13.5," ; curpol=",es13.5," ;")') myid, curtor, curpol RlBCAST( curtor, 1, llmodnp ) RlBCAST( curpol, 1, llmodnp ) endif diff --git a/src/casing.f90 b/src/casing.f90 index fa9afb6f..f93634d4 100644 --- a/src/casing.f90 +++ b/src/casing.f90 @@ -194,8 +194,8 @@ subroutine casing( teta, zeta, gBn, icasing ) ; ; if( Wcasing ) write(ounit,1001) cput-cpus, myid, Dxyz(1:3,globaljk), gBn, absest(1:Nfun), idcuhre, minpts, maxpts #endif -1001 format("casing : ",f10.2," : myid=",i3," ; [x,y,z]=["es10.2" ,"es10.2" ,"es10.2" ]; gBn="es12.4" , ",& - "err="es8.0" ; ifail="i3" ; min/max calls="2i12" ; "a24) +1001 format("casing : ",f10.2," : myid=",i3," ; [x,y,z]=["es10.2" ,"es10.2" ,"es10.2" ]; gBn=",es12.4" , ",& + "err=",es8.0," ; ifail=",i3," ; min/max calls="2i12," ; "a24) !-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-! diff --git a/src/curent.f90 b/src/curent.f90 index 59012204..26a1fa8e 100644 --- a/src/curent.f90 +++ b/src/curent.f90 @@ -176,8 +176,8 @@ subroutine curent( lvol, mn, Nt, Nz, iflag, ldItGp ) ! ! endif ! end of if( Wcurent ) ; 05 Feb 16; ! -!1000 format("curent : " 10x " : myid="i3" ; ideriv ="i2" ; ("i3","i3" ) : I_n ="es13.5" ;") -!1010 format("curent : " 10x " : myid="i3" ; ideriv ="i2" ; ("i3","i3" ) : G_m ="es13.5" ;") +!1000 format("curent : " 10x " : myid=",i3," ; ideriv =",i2," ; ("i3","i3" ) : I_n =",es13.5," ;") +!1010 format("curent : " 10x " : myid=",i3," ; ideriv =",i2," ; ("i3","i3" ) : G_m =",es13.5," ;") ! !#endif diff --git a/src/dforce.f90 b/src/dforce.f90 index 3c110cd0..5f36c0aa 100644 --- a/src/dforce.f90 +++ b/src/dforce.f90 @@ -362,12 +362,12 @@ subroutine dforce( NGdof, position, force, LComputeDerivatives, LComputeAxis) ! #ifdef DEBUG ! select case( ihybrd1 ) -! case( 1 ) ; write(ounit,'("dforce : ",f10.2," : finished ; success ; dpflux = ", es12.5, ", its="i7";")') cput-cpus, dpflux, nfev -! case( 0 ) ; write(ounit,'("dforce : ",f10.2," : finished ; input error ; dpflux = ", es12.5, ", its="i7";")') cput-cpus, dpflux, nfev -! case( 2 ) ; write(ounit,'("dforce : ",f10.2," : finished ; max. iter ; dpflux = ", es12.5, ", its="i7";")') cput-cpus, dpflux, nfev -! case( 3 ) ; write(ounit,'("dforce : ",f10.2," : finished ; xtol too small ; dpflux = ", es12.5, ", its="i7";")') cput-cpus, dpflux, nfev -! case( 4:5 ) ; write(ounit,'("dforce : ",f10.2," : finished ; bad progress ; dpflux = ", es12.5, ", its="i7";")') cput-cpus, dpflux, nfev -! case default ; write(ounit,'("dforce : ",f10.2," : finished ; illegal ifail ; dpflux = ", es12.5, ", its="i7";")') cput-cpus, dpflux, nfev +! case( 1 ) ; write(ounit,'("dforce : ",f10.2," : finished ; success ; dpflux = ", es12.5, ", its=",i7";")') cput-cpus, dpflux, nfev +! case( 0 ) ; write(ounit,'("dforce : ",f10.2," : finished ; input error ; dpflux = ", es12.5, ", its=",i7";")') cput-cpus, dpflux, nfev +! case( 2 ) ; write(ounit,'("dforce : ",f10.2," : finished ; max. iter ; dpflux = ", es12.5, ", its=",i7";")') cput-cpus, dpflux, nfev +! case( 3 ) ; write(ounit,'("dforce : ",f10.2," : finished ; xtol too small ; dpflux = ", es12.5, ", its=",i7";")') cput-cpus, dpflux, nfev +! case( 4:5 ) ; write(ounit,'("dforce : ",f10.2," : finished ; bad progress ; dpflux = ", es12.5, ", its=",i7";")') cput-cpus, dpflux, nfev +! case default ; write(ounit,'("dforce : ",f10.2," : finished ; illegal ifail ; dpflux = ", es12.5, ", its=",i7";")') cput-cpus, dpflux, nfev ! end select ! #endif @@ -382,8 +382,8 @@ subroutine dforce( NGdof, position, force, LComputeDerivatives, LComputeAxis) call WhichCpuID(vvol, cpu_id) ! Broadcast all ImagneticOK - !write(ounit,'("dforce : " 10x " : myid="i3"; vvol="i3"; ; ImagneticOK="999L2)') myid, vvol, ImagneticOK(1:Mvol) - !write(ounit,'("dforce : " 10x " : cpu_id="i3"; vvol="i3"; ; ImagneticOK="999L2)') cpu_id, vvol, ImagneticOK(vvol) + !write(ounit,'("dforce : " 10x " : myid=",i3"; vvol=",i3"; ; ImagneticOK="999L2)') myid, vvol, ImagneticOK(1:Mvol) + !write(ounit,'("dforce : " 10x " : cpu_id=",i3"; vvol=",i3"; ; ImagneticOK="999L2)') cpu_id, vvol, ImagneticOK(vvol) LlBCAST( ImagneticOK(vvol) , 1, cpu_id) do ideriv=0,2 @@ -422,7 +422,7 @@ subroutine dforce( NGdof, position, force, LComputeDerivatives, LComputeAxis) FATAL( dforce, Lcheck.eq.2, finished computing derivatives of rotational-transform wrt mu and dpflux ) - if( Wdforce ) write(ounit,'("dforce : " 10x " : myid="i3" ; LComputeDerivatives="L2" ; ImagneticOK="999L2)') myid, LComputeDerivatives, ImagneticOK(1:Mvol) + if( Wdforce ) write(ounit,'("dforce : " 10x " : myid=",i3," ; LComputeDerivatives=",L2," ; ImagneticOK="999L2)') myid, LComputeDerivatives, ImagneticOK(1:Mvol) #endif !-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-! @@ -438,7 +438,7 @@ subroutine dforce( NGdof, position, force, LComputeDerivatives, LComputeAxis) !-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-! #ifdef DEBUG - if( Wdforce ) write(ounit,'("dforce : " 10x " : myid="i3" ; LComputeDerivatives="L2" ; ImagneticOK="999L2)') myid, LComputeDerivatives, ImagneticOK(1:Mvol) + if( Wdforce ) write(ounit,'("dforce : " 10x " : myid=",i3," ; LComputeDerivatives=",L2," ; ImagneticOK="999L2)') myid, LComputeDerivatives, ImagneticOK(1:Mvol) #endif !-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-! @@ -856,7 +856,7 @@ subroutine dforce( NGdof, position, force, LComputeDerivatives, LComputeAxis) #ifdef DEBUG if( idof.gt.LGdof ) write(ounit,1000) myid, vvol, ii, irz, issym, idof, LGdof ! can be deleted; -1000 format("hforce : " 10x " : myid=",i3," ; vvol=",i3," ; ii= ",i3," ; irz="i3" ; issym="i3" ; idof="i3" ; LGdof="i3" ;") +1000 format("hforce : " 10x " : myid=",i3," ; vvol=",i3," ; ii= ",i3," ; irz=",i3," ; issym=",i3," ; idof=",i3," ; LGdof=",i3," ;") FATAL( hforce, idof.gt.LGdof, illegal degree-of-freedom index constructing hessian ) ! can be deleted; #endif @@ -977,7 +977,7 @@ subroutine dforce( NGdof, position, force, LComputeDerivatives, LComputeAxis) !-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-! if(Lhessianallocated .and. Igeometry.eq.1) then - if( myid.eq.0 ) then ; cput = GETTIME ; write(ounit,'("hesian : ",f10.2," : LHmatrix="L2" ;")')cput-cpus, LHmatrix ; + if( myid.eq.0 ) then ; cput = GETTIME ; write(ounit,'("hesian : ",f10.2," : LHmatrix=",L2," ;")')cput-cpus, LHmatrix ; write(*,*) "Writing .hessian file..." open(munit, file=trim(ext)//".sp.hessian", status="unknown", form="unformatted") write(munit) NGdof diff --git a/src/dfp200.f90 b/src/dfp200.f90 index 311a7dfa..bc4aba95 100644 --- a/src/dfp200.f90 +++ b/src/dfp200.f90 @@ -1303,8 +1303,8 @@ subroutine evaluate_dmupfdx(innout, idof, ii, issym, irz) write(ounit,3004) cput-cpus, myid, vvol, im(ii), in(ii), irz, issym, 1, "dpflux analytic ", dmupfdx(1:Mvol,vvol,2,idof,1) / lfactor endif -3003 format("dfp200 : ",f10.2," : ",:,"myid=",i3," ; vvol=",i2," ; (",i2,",",i3," ) ; irz=",i1," ; issym=",i1," ; innout=",i1," ; ",a18," : dmupf=",8f11.05" ;") -3004 format("dfp200 : ",f10.2," : ",:,"myid=",i3," ; vvol=",i2," ; (",i2,",",i3," ) ; irz=",i1," ; issym=",i1," ; innout=",i1," ; ",a18," : dmupf=",8f11.05" ;") +3003 format("dfp200 : ",f10.2," : ",:,"myid=",i3," ; vvol=",i2," ; (",i2,",",i3," ) ; irz=",i1," ; issym=",i1," ; innout=",i1," ; ",a18," : dmupf=",8f11.05," ;") +3004 format("dfp200 : ",f10.2," : ",:,"myid=",i3," ; vvol=",i2," ; (",i2,",",i3," ) ; irz=",i1," ; issym=",i1," ; innout=",i1," ; ",a18," : dmupf=",8f11.05," ;") ! Re-evaluate unperturbed solution @@ -1596,7 +1596,7 @@ subroutine evaluate_dBB(lvol, idof, innout, issym, irz, ii, dBB, XX, YY, length, if( iocons.eq.0 ) then ! take derivatives of constraints at inner boundary; if( innout.eq.0 ) then ! derivative wrt inner boundary coefficient; - !write(ounit,'("dfp200 : " 10x " : A ; lvol="i3" ; iocons="i2" ; innout="i2" ;")') lvol, iocons, innout + !write(ounit,'("dfp200 : " 10x " : A ; lvol=",i3," ; iocons=",i2," ; innout=",i2," ;")') lvol, iocons, innout if( issym.eq.0 ) then ! take derivatives wrt Rbc and Zbs; if( irz.eq.0 ) then ; dLL(1:Ntz) = + ( - cosi(1:Ntz,ii) * tRij(1:Ntz,lvol-1) - dRij(1:Ntz,lvol) * im(ii) * sini(1:Ntz,ii) ) / length(1:Ntz) & + constraint(1:Ntz) * dRij(1:Ntz,lvol) * cosi(1:Ntz,ii) / length(1:Ntz) / length(1:Ntz) @@ -1611,7 +1611,7 @@ subroutine evaluate_dBB(lvol, idof, innout, issym, irz, ii, dBB, XX, YY, length, endif endif else ! if innout.eq.1 ; derivative wrt outer boundary coefficient; - !write(ounit,'("dfp200 : " 10x " : B ; lvol="i3" ; iocons="i2" ; innout="i2" ;")') lvol, iocons, innout + !write(ounit,'("dfp200 : " 10x " : B ; lvol=",i3," ; iocons=",i2," ; innout=",i2," ;")') lvol, iocons, innout if( issym.eq.0 ) then ! take derivatives wrt Rbc and Zbs; if( irz.eq.0 ) then ; dLL(1:Ntz) = + ( + cosi(1:Ntz,ii) * tRij(1:Ntz,lvol-1) ) / length(1:Ntz) & - constraint(1:Ntz) * dRij(1:Ntz,lvol) * cosi(1:Ntz,ii) / length(1:Ntz) / length(1:Ntz) @@ -1630,7 +1630,7 @@ subroutine evaluate_dBB(lvol, idof, innout, issym, irz, ii, dBB, XX, YY, length, else ! if iocons.eq.1 ; take derivatives of constraints at outer boundary; if( innout.eq.0 ) then ! derivative wrt inner boundary coefficient; - !write(ounit,'("dfp200 : " 10x " : C ; lvol="i3" ; iocons="i2" ; innout="i2" ;")') lvol, iocons, innout + !write(ounit,'("dfp200 : " 10x " : C ; lvol=",i3," ; iocons=",i2," ; innout=",i2," ;")') lvol, iocons, innout if( issym.eq.0 ) then ! take derivatives wrt Rbc and Zbs; if( irz.eq.0 ) then ; dLL(1:Ntz) = + ( - cosi(1:Ntz,ii) * tRij(1:Ntz,lvol ) ) / length(1:Ntz) & + constraint(1:Ntz) * dRij(1:Ntz,lvol) * cosi(1:Ntz,ii) / length(1:Ntz) / length(1:Ntz) @@ -1650,14 +1650,14 @@ subroutine evaluate_dBB(lvol, idof, innout, issym, irz, ii, dBB, XX, YY, length, !#else ! if( Igeometry.eq.3 .and. lvol.lt.1 ) then ! need to accomodate derivatives of coordinate axis; !#endif - !write(ounit,'("dfp200 : " 10x " : dRodR(1: ,0,"i2")=",99es11.3)') ii, dRodR(1:20,0,ii) - !write(ounit,'("dfp200 : " 10x " : dRodR(1: ,1,"i2")=",99es11.3)') ii, dRodR(1:20,1,ii) - !write(ounit,'("dfp200 : " 10x " : dRodZ(1: ,0,"i2")=",99es11.3)') ii, dRodZ(1:20,0,ii) - !write(ounit,'("dfp200 : " 10x " : dRodZ(1: ,1,"i2")=",99es11.3)') ii, dRodZ(1:20,1,ii) - !write(ounit,'("dfp200 : " 10x " : dZodR(1: ,0,"i2")=",99es11.3)') ii, dZodR(1:20,0,ii) - !write(ounit,'("dfp200 : " 10x " : dZodR(1: ,1,"i2")=",99es11.3)') ii, dZodR(1:20,1,ii) - !write(ounit,'("dfp200 : " 10x " : dZodZ(1: ,0,"i2")=",99es11.3)') ii, dZodZ(1:20,0,ii) - !write(ounit,'("dfp200 : " 10x " : dZodZ(1: ,1,"i2")=",99es11.3)') ii, dZodZ(1:20,1,ii) + !write(ounit,'("dfp200 : " 10x " : dRodR(1: ,0,"i2,")=",99es11.3)') ii, dRodR(1:20,0,ii) + !write(ounit,'("dfp200 : " 10x " : dRodR(1: ,1,"i2,")=",99es11.3)') ii, dRodR(1:20,1,ii) + !write(ounit,'("dfp200 : " 10x " : dRodZ(1: ,0,"i2,")=",99es11.3)') ii, dRodZ(1:20,0,ii) + !write(ounit,'("dfp200 : " 10x " : dRodZ(1: ,1,"i2,")=",99es11.3)') ii, dRodZ(1:20,1,ii) + !write(ounit,'("dfp200 : " 10x " : dZodR(1: ,0,"i2,")=",99es11.3)') ii, dZodR(1:20,0,ii) + !write(ounit,'("dfp200 : " 10x " : dZodR(1: ,1,"i2,")=",99es11.3)') ii, dZodR(1:20,1,ii) + !write(ounit,'("dfp200 : " 10x " : dZodZ(1: ,0,"i2,")=",99es11.3)') ii, dZodZ(1:20,0,ii) + !write(ounit,'("dfp200 : " 10x " : dZodZ(1: ,1,"i2,")=",99es11.3)') ii, dZodZ(1:20,1,ii) if( issym.eq.0 ) then ! take derivatives wrt Rbc and Zbs; if( irz.eq.0 ) then ; dLL(1:Ntz) = ( & ! d/dRbc ; + ( cosi(1:Ntz,ii) - dRodR(1:Ntz,0,ii) ) * tRij(1:Ntz,lvol) - dRij(1:Ntz,lvol) * im(ii) * sini(1:Ntz,ii) & @@ -2105,7 +2105,7 @@ subroutine hessian3D_dFFdRZ(lvol, idof, innout, issym, irz, ii, dBB, XX, YY, len ! FATAL(dfp200, .true. work progress for hessian axisymmetric ) !endif - !write(ounit,'("hesian3D : ",f10.2," : efcol1="f10.2")') cput-cpus, efcol1mn(1:mn) + !write(ounit,'("hesian3D : ",f10.2," : efcol1=",f10.2,")') cput-cpus, efcol1mn(1:mn) !print * , Mvol, efcol1mn(1:mn) !write(ounit,1000) 'values are:' Mvol, efcol1mn(1:mn) !write(90,1000) efcol1mn(1:mn) diff --git a/src/global.f90 b/src/global.f90 index 3f359850..620071e0 100644 --- a/src/global.f90 +++ b/src/global.f90 @@ -1217,11 +1217,11 @@ subroutine check_inputs() write(ounit,1014) pscale, Ladiabatic, Lconstraint, mupftol, mupfits write(ounit,1015) Lrad(1:min(Mvol,32)) -1010 format("readin : ",f10.2," : Igeometry=",i3," ; Istellsym=",i3," ; Lreflect="i3" ;") -1011 format("readin : ", 10x ," : Lfreebound=",i3," ; phiedge="es23.15" ; curtor="es23.15" ; curpol="es23.15" ;") -1012 format("readin : ", 10x ," : gamma="es23.15" ;") +1010 format("readin : ",f10.2," : Igeometry=",i3," ; Istellsym=",i3," ; Lreflect=",i3," ;") +1011 format("readin : ", 10x ," : Lfreebound=",i3," ; phiedge=",es23.15," ; curtor=",es23.15," ; curpol=",es23.15," ;") +1012 format("readin : ", 10x ," : gamma=",es23.15," ;") 1013 format("readin : ", 10x ," : Nfp=",i3," ; Nvol=",i3," ; Mvol=",i3," ; Mpol=",i3," ; Ntor=",i3," ;") -1014 format("readin : ", 10x ," : pscale="es13.5" ; Ladiabatic="i2" ; Lconstraint="i3" ; mupf: tol,its="es10.2" ,"i4" ;") +1014 format("readin : ", 10x ," : pscale=",es13.5," ; Ladiabatic=",i2," ; Lconstraint=",i3," ; mupf: tol,its=",es10.2," ,",i4," ;") 1015 format("readin : ", 10x ," : Lrad = "257(i2,",",:)) #ifdef DEBUG @@ -1327,7 +1327,7 @@ subroutine check_inputs() enddo if (Igeometry.ge.2 .and. Lrad(1).lt.Mpol) then - write(ounit,'("readin : ",f10.2," : Minimum Lrad(1) is Mpol, automatically adjusted it to Mpol+4")') cput-cpus + write(ounit,'("readin : ",f10.2," : Minimum Lrad(1) is Mpol, automatically adjusted it to Mpol+4,")') cput-cpus Lrad(1) = Mpol + 4 endif FATAL( readin, mupfits.le.0, must give ma01aa:hybrj a postive integer value for the maximum iterations = mupfits given on input ) @@ -1343,10 +1343,10 @@ subroutine check_inputs() write(ounit,1022) Lsparse, Lsvdiota, imethod, iorder, iprecon, iotatol write(ounit,1023) Lextrap, Mregular, Lrzaxis, Ntoraxis -1020 format("readin : ",f10.2," : Linitialize=",i3," ;LautoinitBn=",i3," ; Lzerovac=",i2," ; Ndiscrete="i2" ;") -1021 format("readin : ", 10x ," : Nquad="i4" ; iMpol="i4" ; iNtor="i4" ;") -1022 format("readin : ", 10x ," : Lsparse="i2" ; Lsvdiota="i2" ; imethod="i2" ; iorder="i2" ; iprecon="i2" ; iotatol="es13.5" ;") -1023 format("readin : ", 10x ," : Lextrap="i2" ; Mregular="i3" ; Lrzaxis="i2" ; Ntoraxis="i2" ; Lvcgrid="i2" ;") +1020 format("readin : ",f10.2," : Linitialize=",i3," ;LautoinitBn=",i3," ; Lzerovac=",i2," ; Ndiscrete=",i2," ;") +1021 format("readin : ", 10x ," : Nquad=",i4," ; iMpol=",i4," ; iNtor=",i4," ;") +1022 format("readin : ", 10x ," : Lsparse=",i2," ; Lsvdiota=",i2," ; imethod=",i2," ; iorder=",i2," ; iprecon=",i2," ; iotatol=",es13.5," ;") +1023 format("readin : ", 10x ," : Lextrap=",i2," ; Mregular=",i3," ; Lrzaxis=",i2," ; Ntoraxis=",i2," ; Lvcgrid=",i2," ;") FATAL( readin, Ndiscrete.le.0, error ) @@ -1368,7 +1368,7 @@ subroutine check_inputs() write(ounit,1030) cput-cpus, LBeltrami, Linitgues, Lmatsolver, LGMRESprec, NiterGMRES, epsGMRES, epsILU -1030 format("readin : ",f10.2," : LBeltrami="i2" ; Linitgues="i2" ; Lmatsolver="i2" ; LGMRESprec="i2" ; NiterGMRES="i4" ; epsGMRES="es13.5" ; epsILU="es13.5" ;" ) +1030 format("readin : ",f10.2," : LBeltrami=",i2," ; Linitgues=",i2," ; Lmatsolver=",i2," ; LGMRESprec=",i2," ; NiterGMRES=",i4," ; epsGMRES=",es13.5," ; epsILU=",es13.5," ;" ) FATAL( readin, LBeltrami.lt.0 .or. LBeltrami.gt.7, error ) FATAL( readin, Lmatsolver.lt.0 .or. Lmatsolver.gt.3, error ) @@ -1389,11 +1389,11 @@ subroutine check_inputs() write(ounit,1043) mfreeits, gBntol, gBnbld write(ounit,1044) vcasingeps, vcasingtol, vcasingits, vcasingper, vcNt, vcNz -1040 format("readin : ",f10.2," : Lfindzero="i2" ;") -1041 format("readin : ", 10x ," : escale="es13.5" ; opsilon="es13.5" ; pcondense="f7.3" ; epsilon="es13.5" ; wpoloidal="f7.4" ; upsilon="es13.5" ;") -1042 format("readin : ", 10x ," : forcetol="es13.5" ; c05xmax="es13.5" ; c05xtol="es13.5" ; c05factor="es13.5" ; LreadGF="L2" ; ") -1043 format("readin : ", 10x ," : mfreeits="i4" ; gBntol="es13.5" ; gBnbld="es13.5" ;") -1044 format("readin : ", 10x ," : vcasingeps="es13.5" ; vcasingtol="es13.5" ; vcasingits="i6" ; vcasingper="i6" ; vcNt="i6" ; vcNz="i6" ;") +1040 format("readin : ",f10.2," : Lfindzero=",i2," ;") +1041 format("readin : ", 10x ," : escale=",es13.5," ; opsilon=",es13.5," ; pcondense=",f7.3," ; epsilon=",es13.5," ; wpoloidal=",f7.4," ; upsilon=",es13.5," ;") +1042 format("readin : ", 10x ," : forcetol=",es13.5," ; c05xmax=",es13.5," ; c05xtol=",es13.5," ; c05factor=",es13.5," ; LreadGF=",L2," ; ") +1043 format("readin : ", 10x ," : mfreeits=",i4," ; gBntol=",es13.5," ; gBnbld=",es13.5," ;") +1044 format("readin : ", 10x ," : vcasingeps=",es13.5," ; vcasingtol=",es13.5," ; vcasingits=",i6," ; vcasingper=",i6," ; vcNt=",i6," ; vcNz=",i6," ;") FATAL( readin, escale .lt.zero , error ) FATAL( readin, pcondense .lt.one , error ) @@ -1412,8 +1412,8 @@ subroutine check_inputs() write(ounit,1050) cput-cpus, odetol, nPpts write(ounit,1051) LHevalues, LHevectors, LHmatrix, Lperturbed, dpp, dqq, dRZ, Lcheck, Ltiming -1050 format("readin : ",f10.2," : odetol="es10.2" ; nPpts="i6" ;") -1051 format("readin : ", 10x ," : LHevalues="L2" ; LHevectors="L2" ; LHmatrix="L2" ; Lperturbed="i2" ; dpp="i3" ; dqq="i3" ; dRZ="es16.8" ; Lcheck="i3" ; Ltiming="L2" ;") +1050 format("readin : ",f10.2," : odetol=",es10.2," ; nPpts=",i6," ;") +1051 format("readin : ", 10x ," : LHevalues=",L2," ; LHevectors=",L2," ; LHmatrix=",L2," ; Lperturbed=",i2," ; dpp=",i3," ; dqq=",i3," ; dRZ=",es16.8," ; Lcheck=",i3," ; Ltiming=",L2," ;") FATAL( readin, odetol.le.zero, input error ) !FATAL( readin, absreq.le.zero, input error ) diff --git a/src/hesian.f90 b/src/hesian.f90 index ff7cf149..5ca94466 100644 --- a/src/hesian.f90 +++ b/src/hesian.f90 @@ -192,8 +192,8 @@ subroutine hesian( NGdof, position, Mvol, mn, LGdof ) write(ounit,1001) cput-cpus, myid, vvol, irz, mi, ni, ( oBBdRZ(vvol,1,idof) + oBBdRZ(vvol+1,0,idof) ) / psifactor(ii,vvol) ! ENERGY GRADIENT; FATAL( hesian, Igeometry.eq.1, Cartesian geometry does not need regularization factor ) -1000 format("hesian : ",f10.2," : ":"myid=",i3," ; ":"vvol=",i3," ; ":"irz="i2" ; (",i3," ,",i3," ) ; "a17" ["es15.7","es15.7" ]") -1001 format("hesian : ",f10.2," : ":"myid=",i3," ; ":"vvol=",i3," ; ":"irz="i2" ; (",i3," ,",i3," ) ; "es15.7" ; ") +1000 format("hesian : ",f10.2," : ":"myid=",i3," ; ":"vvol=",i3," ; ":"irz=",i2," ; (",i3," ,",i3," ) ; "a17," ["es15.7","es15.7" ]") +1001 format("hesian : ",f10.2," : ":"myid=",i3," ; ":"vvol=",i3," ; ":"irz=",i2," ; (",i3," ,",i3," ) ; "es15.7," ; ") enddo ! end of do issym; 26 Feb 13; @@ -373,9 +373,9 @@ subroutine hesian( NGdof, position, Mvol, mn, LGdof ) #endif 1001 format("hesian : ",f10.2," : myid=",i3, & - " ; vvol=",i3," ; ("i4" ,"i4" ); irz="i2" ; issym="i2" ; tdof="i6 & - " ; jvol="i4" ; ("i4" ,"i4" ); jrz="i2" ; jssym="i2" ; tdoc="i6 & - " ; fd-estimate="es13.5" & hessian("i6","i6" )="es13.5" ;":" err="es13.5" ;":,f12.4" ;") + " ; vvol=",i3," ; ("i4" ,"i4" ); irz=",i2," ; issym=",i2," ; tdof=",i6 & + " ; jvol=",i4," ; ("i4" ,"i4" ); jrz=",i2," ; jssym=",i2," ; tdoc=",i6 & + " ; fd-estimate=",es13.5" & hessian("i6","i6" )=",es13.5," ;":" err=",es13.5," ;":,f12.4," ;") enddo ! end of do issym; @@ -426,7 +426,7 @@ subroutine hesian( NGdof, position, Mvol, mn, LGdof ) ! if( LHmatrix ) then ! -! if( myid.eq.0 ) then ; cput = GETTIME ; write(ounit,'("hesian : ",f10.2," : LHmatrix="L2" ;")')cput-cpus, LHmatrix ; +! if( myid.eq.0 ) then ; cput = GETTIME ; write(ounit,'("hesian : ",f10.2," : LHmatrix=",L2," ;")')cput-cpus, LHmatrix ; ! open(munit, file=trim(get_hidden(ext))//".GF.ma", status="unknown", form="unformatted") ! write(munit) NGdof ! write(munit) ohessian(1:NGdof,1:NGdof) @@ -439,7 +439,7 @@ subroutine hesian( NGdof, position, Mvol, mn, LGdof ) ! if( myid.eq.0 .and. ( LHevalues .or. LHevectors ) ) then ! the call to dforce below requires all cpus; 04 Dec 14; if( ( LHevalues .or. LHevectors ) ) then - if( myid.eq.0 ) then ; cput = GETTIME ; write(ounit,'("hesian : ",f10.2," : LHevalues="L2" , LHevectors="L2" ;")')cput-cpus, LHevalues, LHevectors + if( myid.eq.0 ) then ; cput = GETTIME ; write(ounit,'("hesian : ",f10.2," : LHevalues=",L2" , LHevectors=",L2," ;")')cput-cpus, LHevalues, LHevectors endif evalr(1:NGdof) = zero ; evecr(1:NGdof,1:NGdof) = zero @@ -469,11 +469,11 @@ subroutine hesian( NGdof, position, Mvol, mn, LGdof ) if( myid.eq.0 ) then cput = GETTIME if (if02ebf < 0) then - write(ounit,'("hesian : ",f10.2," : DGEEV error the "i2" th argument had illegal value ; time="f10.2"s ;")') cput-cpus, -if02ebf, cput-cpul + write(ounit,'("hesian : ",f10.2," : DGEEV error the "i2" th argument had illegal value ; time=",f10.2"s ;")') cput-cpus, -if02ebf, cput-cpul else if (if02ebf > 0) then - write(ounit,'("hesian : ",f10.2," : DGEEV error, factorization failed ; time="f10.2"s ;")') cput-cpus, cput-cpul + write(ounit,'("hesian : ",f10.2," : DGEEV error, factorization failed ; time=",f10.2"s ;")') cput-cpus, cput-cpul else - write(ounit,'("hesian : ",f10.2," : computed evalues ; if02ebf="i2" ; success ; time="f10.2"s ;")') cput-cpus, if02ebf, cput-cpul + write(ounit,'("hesian : ",f10.2," : computed evalues ; if02ebf=",i2," ; success ; time=",f10.2"s ;")') cput-cpus, if02ebf, cput-cpul endif endif @@ -481,7 +481,7 @@ subroutine hesian( NGdof, position, Mvol, mn, LGdof ) ! ieval(1:1) = minloc( evalr(1:NGdof) ) ! 04 Dec 14; ! if( myid.eq.0) then ! screen output; 04 Dec 14; -! write(ounit,'("hesian : " 10x " : evalr("i4") ="es13.5" ="es13.5" ;")') ieval(1), evalr(ieval(1)), minval(evalr(1:NGdof)) +! write(ounit,'("hesian : " 10x " : evalr("i4,") =",es13.5" =",es13.5," ;")') ieval(1), evalr(ieval(1)), minval(evalr(1:NGdof)) ! endif ! ! do ifd = -1, -6, -1 ; dRZ = ten**ifd @@ -497,7 +497,7 @@ subroutine hesian( NGdof, position, Mvol, mn, LGdof ) ! write(ounit,'("hesian : " 10x " : ",2es23.15," ;")') Energy - oldEnergy(0), ( Energy-oldEnergy(0) ) / dRZ**2 ! write(ounit,'("hesian : " 10x " : ",2es23.15," ;")') evalr(ieval(1)) * dRZ**2, evalr(ieval(1)) ! !write(ounit,'("hesian : " 10x " : |evector| =",es23.15," ;")') sum(evecr(1:NGdof,ieval(1))*evecr(1:NGdof,ieval(1))) -! !write(ounit,'("hesian : ", 10x " : "999(" ("i3","i3")":))') (/ ( im(ii), in(ii), ii = 1, mn ) /) +! !write(ounit,'("hesian : ", 10x " : "999(" ("i3","i3,")":))') (/ ( im(ii), in(ii), ii = 1, mn ) /) ! !do lvol = 1, Mvol-1 ! ! write(ounit,'("hesian : ",i10 " : "999es10.2 )') lvol, evecr(1+mn*(lvol-1):mn+mn*(lvol-1),ieval(1)) ! !enddo @@ -509,7 +509,7 @@ subroutine hesian( NGdof, position, Mvol, mn, LGdof ) ! ! enddo ! end of do ifd; 04 Dec 14; ! -! !do igdof = 1, NGdof ; write(ounit,'("hesian : " 10x " : "f15.11" ="f15.11" ;")') evecr(igdof,ieval(1)), ff(igdof,0) / dRZ / evalr(ieval(1)) +! !do igdof = 1, NGdof ; write(ounit,'("hesian : " 10x " : "f15.11" =",f15.11," ;")') evecr(igdof,ieval(1)), ff(igdof,0) / dRZ / evalr(ieval(1)) ! !enddo ! ! pack = 'U' !; position(0) = zero ! this is not used; 11 Aug 14; ! reset geometry (Rbc, Zbs, etc.) to original values; 04 Dec 14; @@ -533,8 +533,8 @@ subroutine hesian( NGdof, position, Mvol, mn, LGdof ) do iev = 1, NGdof ! loop over all eigenvalues; 04 Dec 14; if( evalr(iev).lt.zero ) then ! only show unstable eigenvalues; 04 Dec 14; - write(ounit,'("hesian : ",f10.2," : evalr="es13.5" ; ")') cput-cpus, evalr(iev) - write(ounit,'("hesian : ",es10.3," : "999(" ("i3","i3")":))') evalr(iev), (/ ( im(ii), in(ii), ii = 1, mn ) /) + write(ounit,'("hesian : ",f10.2," : evalr=",es13.5," ; ")') cput-cpus, evalr(iev) + write(ounit,'("hesian : ",es10.3," : "999(" ("i3","i3,")":))') evalr(iev), (/ ( im(ii), in(ii), ii = 1, mn ) /) do lvol = 1, Mvol-1 ; write(ounit,'("hesian : ",i10 " : "999es10.2)') lvol, evecr(1+mn*(lvol-1):mn+mn*(lvol-1),iev) enddo endif @@ -566,9 +566,9 @@ subroutine hesian( NGdof, position, Mvol, mn, LGdof ) ! do jev = 1, NGdof ! if( irank(jev).eq.iev ) then ! if( LHevectors ) then -! write(ounit,'("hesian : ",f10.2," : ",i6," : evalr="es10.2" ; ":"evecr="999f8.3)') cput-cpus, iev, evalr(jev), evecr(1:NGdof,jev) +! write(ounit,'("hesian : ",f10.2," : ",i6," : evalr=",es10.2," ; ":"evecr="999f8.3)') cput-cpus, iev, evalr(jev), evecr(1:NGdof,jev) ! !if( evalr(jev).lt.zero ) write(ounit,'(13es13.05)') evecr(1:NGdof,jev) -! write(ounit,'("hesian : ",f10.2," : ",i6," : evali="es10.2" ; ":"eveci="999f8.3)') cput-cpus, iev, evali(jev), eveci(1:NGdof,jev) +! write(ounit,'("hesian : ",f10.2," : ",i6," : evali=",es10.2," ; ":"eveci="999f8.3)') cput-cpus, iev, evali(jev), eveci(1:NGdof,jev) ! write(ounit,'("hesian : ",f10.2," : ":" " )') cput-cpus ! else ! write(ounit,'("hesian : ",f10.2," : ",i6," : evalue=(",es13.5," ,",es13.5," ) ;")') cput-cpus, iev, evalr(jev), evali(jev) ! 04 Dec 14; @@ -628,9 +628,9 @@ subroutine hesian( NGdof, position, Mvol, mn, LGdof ) work4(1:4*NGdof), iwork4(1:NGdof), idgesvx ) select case( idgesvx ) - case( 0 ) ; write(ounit,'("hesian : " 10x " : myid="i3" ; linear perturbation ; idgesvx="i3" ;")') myid, idgesvx - case( 1: ) ; write(ounit,'("hesian : " 10x " : myid="i3" ; singular matrix ; idgesvx="i3" ;")') myid, idgesvx - case( :-1 ) ; write(ounit,'("hesian : " 10x " : myid="i3" ; input error ; idgesvx="i3" ;")') myid, idgesvx + case( 0 ) ; write(ounit,'("hesian : " 10x " : myid=",i3," ; linear perturbation ; idgesvx=",i3," ;")') myid, idgesvx + case( 1: ) ; write(ounit,'("hesian : " 10x " : myid=",i3," ; singular matrix ; idgesvx=",i3," ;")') myid, idgesvx + case( :-1 ) ; write(ounit,'("hesian : " 10x " : myid=",i3," ; input error ; idgesvx=",i3," ;")') myid, idgesvx case default ; FATAL( hesian, .true., illegal ifail returned from dgesvx ) end select @@ -683,9 +683,9 @@ subroutine hesian( NGdof, position, Mvol, mn, LGdof ) determinant = sgn*determinant !correct for the sign of the determinant; 09 Nov 17 select case( idgetrf ) - case( 0 ) ; write(ounit,'("hesian : " 10x " : myid="i3" ; idgetrf="i3" ; ; determinant="es13.5" ;")') myid, idgetrf, determinant - case( 1: ) ; write(ounit,'("hesian : " 10x " : myid="i3" ; idgetrf="i3" ; singular ; determinant="es13.5" ;")') myid, idgetrf, determinant - case( :-1 ) ; write(ounit,'("hesian : " 10x " : myid="i3" ; idgetrf="i3" ; input error ; determinant="es13.5" ;")') myid, idgetrf, determinant + case( 0 ) ; write(ounit,'("hesian : " 10x " : myid=",i3," ; idgetrf=",i3," ; ; determinant=",es13.5," ;")') myid, idgetrf, determinant + case( 1: ) ; write(ounit,'("hesian : " 10x " : myid=",i3," ; idgetrf=",i3," ; singular ; determinant=",es13.5," ;")') myid, idgetrf, determinant + case( :-1 ) ; write(ounit,'("hesian : " 10x " : myid=",i3," ; idgetrf=",i3," ; input error ; determinant=",es13.5," ;")') myid, idgetrf, determinant case default ; FATAL( hesian, .true., illegal ifail returned from dgetrf ) end select diff --git a/src/jo00aa.f90 b/src/jo00aa.f90 index 8d594312..578802f7 100644 --- a/src/jo00aa.f90 +++ b/src/jo00aa.f90 @@ -148,7 +148,7 @@ subroutine jo00aa( lvol, Ntz, lquad, mn ) if( Wjo00aa ) write(ounit,1001) weight(1:lquad) -1000 format("jo00aa : ",f10.2," : myid=",i3," ; lvol=",i3," ; icdgqf=",i3," ; "a15" ;":" abscissae ="99f10.6) +1000 format("jo00aa : ",f10.2," : myid=",i3," ; lvol=",i3," ; icdgqf=",i3," ; "a15," ;":" abscissae ="99f10.6) 1001 format("jo00aa : ", 10x ," : "3x" "3x" "3x" "15x" ;":" weights ="99f10.6) FATAL( jo00aa, icdgqf.ne.0, failed to construct Gaussian integration abscisae and weights ) @@ -397,10 +397,10 @@ subroutine jo00aa( lvol, Ntz, lquad, mn ) !>
  • The error is stored into an array called \c beltramierror which is then written to the HDF5 file in hdfint().
  • -1002 format("jo00aa : ",f10.2," : myid=",i3," ; lvol =",i3," ; lrad =",i3," ; AVG E^\R="es23.15" , E^\Z="es23.15" , E^\phi="es23.15" ; time="f8.2"s ;") -1003 format("jo00aa : ",f10.2," : myid=",i3," ; lvol =",i3," ; lrad =",i3," ; MAX E^\R="es23.15" , E^\Z="es23.15" , E^\phi="es23.15" ; time="f8.2"s ;") -1004 format("jo00aa : ",f10.2," : myid=",i3," ; lvol =",i3," ; lrad =",i3," ; AVG E^\s="es23.15" , E^\t="es23.15" , E^\z="es23.15" ; time="f8.2"s ;") -1005 format("jo00aa : ",f10.2," : myid=",i3," ; lvol =",i3," ; lrad =",i3," ; MAX E^\s="es23.15" , E^\t="es23.15" , E^\z="es23.15" ; time="f8.2"s ;") +1002 format("jo00aa : ",f10.2," : myid=",i3," ; lvol =",i3," ; lrad =",i3," ; AVG E^\R=",es23.15" , E^\Z=",es23.15" , E^\phi=",es23.15," ; time=",f8.2"s ;") +1003 format("jo00aa : ",f10.2," : myid=",i3," ; lvol =",i3," ; lrad =",i3," ; MAX E^\R=",es23.15" , E^\Z=",es23.15" , E^\phi=",es23.15," ; time=",f8.2"s ;") +1004 format("jo00aa : ",f10.2," : myid=",i3," ; lvol =",i3," ; lrad =",i3," ; AVG E^\s=",es23.15" , E^\t=",es23.15" , E^\z=",es23.15," ; time=",f8.2"s ;") +1005 format("jo00aa : ",f10.2," : myid=",i3," ; lvol =",i3," ; lrad =",i3," ; MAX E^\s=",es23.15" , E^\t=",es23.15" , E^\z=",es23.15," ; time=",f8.2"s ;") !-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-! @@ -452,8 +452,8 @@ subroutine jo00aa( lvol, Ntz, lquad, mn ) cput = GETTIME ; write(ounit,1007) cput-cpus, myid, lvol, Lrad(lvol), Bst(1:2), cput-cpui ! write error to screen; -1006 format("jo00aa : ",f10.2," : myid=",i3," ; lvol =",i3," ; lrad =",i3," ; MAX gB^s(-1)="es23.15" , gB^s(+1) ="es23.15" ; time="f8.2"s ;") -1007 format("jo00aa : ",f10.2," : myid=",i3," ; lvol =",i3," ; lrad =",i3," ; dtfluxERR ="es23.15" , dpfluxERR="es23.15" ; time="f8.2"s ;") +1006 format("jo00aa : ",f10.2," : myid=",i3," ; lvol =",i3," ; lrad =",i3," ; MAX gB^s(-1)=",es23.15" , gB^s(+1) =",es23.15," ; time=",f8.2"s ;") +1007 format("jo00aa : ",f10.2," : myid=",i3," ; lvol =",i3," ; lrad =",i3," ; dtfluxERR =",es23.15" , dpfluxERR=",es23.15," ; time=",f8.2"s ;") !-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-! diff --git a/src/lforce.f90 b/src/lforce.f90 index 677a5c4f..dea1e0ef 100644 --- a/src/lforce.f90 +++ b/src/lforce.f90 @@ -358,8 +358,8 @@ subroutine lforce( lvol, iocons, ideriv, Ntz, dBB, XX, YY, length, DDl, MMl, ifl #ifdef DEBUG if( Wlforce ) then - write(ounit,'("lforce : ", 10x ," : lvol=",i3," ; iocons="i2" ; Somn="999es13.5)') lvol, iocons, Somn(1:mn,lvol,iocons) - write(ounit,'("lforce : ", 10x ," : lvol=",i3," ; iocons="i2" ; Semn="999es13.5)') lvol, iocons, Semn(1:mn,lvol,iocons) + write(ounit,'("lforce : ", 10x ," : lvol=",i3," ; iocons=",i2," ; Somn="999es13.5)') lvol, iocons, Somn(1:mn,lvol,iocons) + write(ounit,'("lforce : ", 10x ," : lvol=",i3," ; iocons=",i2," ; Semn="999es13.5)') lvol, iocons, Semn(1:mn,lvol,iocons) endif #endif diff --git a/src/ma02aa.f90 b/src/ma02aa.f90 index 4a175dc3..30f184a2 100644 --- a/src/ma02aa.f90 +++ b/src/ma02aa.f90 @@ -636,7 +636,7 @@ subroutine ma02aa( lvol, NN ) DALLOCATE(dsolution) -2000 format("ma02aa : ":,f10.2," :":" myid=",i3," : lvol=",i3," ; jj=",i3," ; "a10" : DF=["es23.15" ,"es23.15" ,"es23.15" ,"es23.15" ] ;") +2000 format("ma02aa : ":,f10.2," :":" myid=",i3," : lvol=",i3," ; jj=",i3," ; "a10," : DF=["es23.15" ,"es23.15" ,"es23.15" ,"es23.15" ] ;") endif ! end of if( Lconstraint.eq.1 .or. Lvacuumregion ) ; @@ -650,13 +650,13 @@ subroutine ma02aa( lvol, NN ) !-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-! -1010 format("ma02aa : ",f10.2," : myid=",i3," ; lvol=",i3," ; SQP : ie04uff=",i3," hel="es12.4" mu="es12.4" dpflux="es12.4" time="f9.1" ":,a36) -1020 format("ma02aa : ",f10.2," : myid=",i3," ; lvol=",i3," ; Newton : ihybrj1=",i3," hel="es12.4" mu="es12.4" dpflux="es12.4" time="f9.1" ; "& - "error="es7.0" ; ":,a18) -1040 format("ma02aa : ",f10.2," : myid=",i3," ; lvol=",i3," ; Linear : ihybrj =",i3," hel="es12.4" mu="es12.4" dpflux="es12.4" time="f9.1" ; "& - :,a16" ; F="2es08.0) -!050 format("ma02aa : ",f10.2," : myid=",i3," ; lvol=",i3," ; Linear : ihybrj =",i3," " 12x " I ="es12.4" " 12x " time="f9.1" ; "& -! :,a16" ; F="2es08.0) +1010 format("ma02aa : ",f10.2," : myid=",i3," ; lvol=",i3," ; SQP : ie04uff=",i3," hel=",es12.4" mu=",es12.4" dpflux=",es12.4" time=",f9.1" ":,a36) +1020 format("ma02aa : ",f10.2," : myid=",i3," ; lvol=",i3," ; Newton : ihybrj1=",i3," hel=",es12.4" mu=",es12.4" dpflux=",es12.4" time=",f9.1," ; "& + "error=",es7.0," ; ":,a18) +1040 format("ma02aa : ",f10.2," : myid=",i3," ; lvol=",i3," ; Linear : ihybrj =",i3," hel=",es12.4" mu=",es12.4" dpflux=",es12.4" time=",f9.1," ; "& + :,a16," ; F="2es08.0) +!050 format("ma02aa : ",f10.2," : myid=",i3," ; lvol=",i3," ; Linear : ihybrj =",i3," " 12x " I =",es12.4" " 12x " time=",f9.1," ; "& +! :,a16," ; F="2es08.0) !-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-! diff --git a/src/matrix.f90 b/src/matrix.f90 index 73466c59..1a5b2fea 100644 --- a/src/matrix.f90 +++ b/src/matrix.f90 @@ -656,8 +656,8 @@ subroutine matrix( lvol, mn, lrad ) endif ! end of if( Wmatrix ) ; -1000 format("matrix : " 10x " : myid="i3" : dMA(ii,jj)="es23.15", dMA(jj,ii)="es23.15", dMA(ii,jj)-dMA(jj,ii)="es13.5" ;") -1001 format("matrix : " 10x " : myid="i3" : dMD(ii,jj)="es23.15", dMD(jj,ii)="es23.15", dMD(ii,jj)-dMD(jj,ii)="es13.5" ;") +1000 format("matrix : " 10x " : myid=",i3," : dMA(ii,jj)=",es23.15", dMA(jj,ii)=",es23.15", dMA(ii,jj)-dMA(jj,ii)=",es13.5," ;") +1001 format("matrix : " 10x " : myid=",i3," : dMD(ii,jj)=",es23.15", dMD(jj,ii)=",es23.15", dMD(ii,jj)-dMD(jj,ii)=",es13.5," ;") #endif diff --git a/src/mp00ac.f90 b/src/mp00ac.f90 index 2ecaf1ab..34eb5a03 100644 --- a/src/mp00ac.f90 +++ b/src/mp00ac.f90 @@ -414,7 +414,7 @@ subroutine mp00ac( Ndof, Xdof, Fdof, Ddof, Ldfjac, iflag ) ! argument list is fi ; write(ounit,1010) cput-cpus, myid, lvol, ideriv, "idgetrf idgetrs idgerfs", idgetrf(ideriv), idgetrs(ideriv), idgetrf(ideriv), "invalid error ; " endif - 1010 format("mp00ac : ",f10.2," : myid=",i3," ; lvol=",i3," ; ideriv="i2" ; "a23"=",i3,' ',i3,' ',i3," ; "a34,:" time=",f10.2," ;") + 1010 format("mp00ac : ",f10.2," : myid=",i3," ; lvol=",i3," ; ideriv=",i2," ; "a23"=",i3,' ',i3,' ',i3," ; "a34,:" time=",f10.2," ;") !-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-! @@ -726,10 +726,10 @@ subroutine mp00ac( Ndof, Xdof, Fdof, Ddof, Ldfjac, iflag ) ! argument list is fi end select endif -3000 format("mp00ac : ",f10.2," : myid=",i3," ; lvol=",i3," ; (mu,dp)=("es23.15" ,"es23.15" ) ; iflag="i2" ;":" F="2es13.05" ;") -3010 format("mp00ac : ",f10.2," : myid=",i3," ; lvol=",i3," ; (mu,dp)=("es23.15" ,"es23.15" ) ; iflag="i2" ;":" D="4es13.05" ;") -3001 format("mp00ac : ",f10.2," : myid=",i3," ; lvol=",i3," ; (dt,dp)=("es23.15" ,"es23.15" ) ; iflag="i2" ;":" F="2es13.05" ;") -3011 format("mp00ac : ",f10.2," : myid=",i3," ; lvol=",i3," ; (dt,dp)=("es23.15" ,"es23.15" ) ; iflag="i2" ;":" D="4es13.05" ;") +3000 format("mp00ac : ",f10.2," : myid=",i3," ; lvol=",i3," ; (mu,dp)=("es23.15" ,"es23.15" ) ; iflag=",i2," ;":" F="2es13.05," ;") +3010 format("mp00ac : ",f10.2," : myid=",i3," ; lvol=",i3," ; (mu,dp)=("es23.15" ,"es23.15" ) ; iflag=",i2," ;":" D="4es13.05," ;") +3001 format("mp00ac : ",f10.2," : myid=",i3," ; lvol=",i3," ; (dt,dp)=("es23.15" ,"es23.15" ) ; iflag=",i2," ;":" F="2es13.05," ;") +3011 format("mp00ac : ",f10.2," : myid=",i3," ; lvol=",i3," ; (dt,dp)=("es23.15" ,"es23.15" ) ; iflag=",i2," ;":" D="4es13.05," ;") endif ! end of if( Wmp00ac .or. Wma02aa ) ; diff --git a/src/newton.f90 b/src/newton.f90 index 123e60a0..bf1abdb7 100644 --- a/src/newton.f90 +++ b/src/newton.f90 @@ -113,7 +113,7 @@ subroutine newton( NGdof, position, ihybrd ) if( Wnewton .and. myid.eq.0 ) then ! screen output; cput = GETTIME write(ounit,'("newton : ", 10x ," : ")') - write(ounit,'("newton : ",f10.2," : Lfindzero="i2" ; forcetol="es13.5" ; c05xtol="es13.5" ; c05factor="es13.5" ; LreadGF="L2" ; NGdof="i6" ;")')& + write(ounit,'("newton : ",f10.2," : Lfindzero=",i2," ; forcetol=",es13.5," ; c05xtol=",es13.5," ; c05factor=",es13.5," ; LreadGF=",L2," ; NGdof=",i6," ;")')& cput-cpus, Lfindzero, forcetol, c05xtol, c05factor, LreadGF, NGdof write(ounit,'("newton : ", 10x ," : ")') endif @@ -170,8 +170,8 @@ subroutine newton( NGdof, position, ihybrd ) !-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-! -1000 format("newton : ",f10.2," : "i9,i3," ; ":"|f|="es12.5" ; ":"time=",f10.2,"s ;":" log"a5"="28f6.2" ...") -1001 format("newton : ", 10x ," : "9x,3x" ; ":" " 12x " ":" ", 10x ," ;":" log"a5"="28f6.2" ...") +1000 format("newton : ",f10.2," : ",i9,i3," ; ",:,"|f|=",es12.5," ; ",:,"time=",f10.2,"s ;",:" log",a5,"=",28f6.2," ...") +1001 format("newton : ", 10x ," : ",9x,3x," ; ",:," ", 12x, " ",:," ", 10x ," ;",:" log",a5,"=",28f6.2," ...") !-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-! @@ -230,12 +230,12 @@ subroutine newton( NGdof, position, ihybrd ) cput = GETTIME ; write(ounit,'("newton : ", 10x ," :")') select case( ihybrd ) - case( 1 ) ; write(ounit,'("newton : ",f10.2," : finished ; success ; ic05p*f="i2" ; its="i7" ,"i4" ;")') cput-cpus, ihybrd, nFcalls, nDcalls - case( 0 ) ; write(ounit,'("newton : ",f10.2," : finished ; input error ; ic05p*f="i2" ; its="i7" ,"i4" ;")') cput-cpus, ihybrd, nFcalls, nDcalls - case( 2 ) ; write(ounit,'("newton : ",f10.2," : finished ; max. iter ; ic05p*f="i2" ; its="i7" ,"i4" ;")') cput-cpus, ihybrd, nFcalls, nDcalls - case( 3 ) ; write(ounit,'("newton : ",f10.2," : finished ; xtol too small ; ic05p*f="i2" ; its="i7" ,"i4" ;")') cput-cpus, ihybrd, nFcalls, nDcalls - case( 4:5 ) ; write(ounit,'("newton : ",f10.2," : finished ; bad progress ; ic05p*f="i2" ; its="i7" ,"i4" ;")') cput-cpus, ihybrd, nFcalls, nDcalls - case default ; write(ounit,'("newton : ",f10.2," : finished ; illegal ifail ; ic05p*f="i2" ; its="i7" ,"i4" ;")') cput-cpus, ihybrd, nFcalls, nDcalls + case( 1 ) ; write(ounit,'("newton : ",f10.2," : finished ; success ; ic05p*f=",i2," ; its=",i7," ,",i4," ;")') cput-cpus, ihybrd, nFcalls, nDcalls + case( 0 ) ; write(ounit,'("newton : ",f10.2," : finished ; input error ; ic05p*f=",i2," ; its=",i7," ,",i4," ;")') cput-cpus, ihybrd, nFcalls, nDcalls + case( 2 ) ; write(ounit,'("newton : ",f10.2," : finished ; max. iter ; ic05p*f=",i2," ; its=",i7," ,",i4," ;")') cput-cpus, ihybrd, nFcalls, nDcalls + case( 3 ) ; write(ounit,'("newton : ",f10.2," : finished ; xtol too small ; ic05p*f=",i2," ; its=",i7," ,",i4," ;")') cput-cpus, ihybrd, nFcalls, nDcalls + case( 4:5 ) ; write(ounit,'("newton : ",f10.2," : finished ; bad progress ; ic05p*f=",i2," ; its=",i7," ,",i4," ;")') cput-cpus, ihybrd, nFcalls, nDcalls + case default ; write(ounit,'("newton : ",f10.2," : finished ; illegal ifail ; ic05p*f=",i2," ; its=",i7," ,",i4," ;")') cput-cpus, ihybrd, nFcalls, nDcalls end select endif ! end of if( myid.eq.0 ) then; @@ -410,7 +410,7 @@ subroutine writereadgf( readorwrite, NGdof , ireadhessian ) 9999 return -2000 format("newton : ",f10.2," : myid=",i3," ; "a31,:" old="i4" ; new="i4" ;") +2000 format("newton : ",f10.2," : myid=",i3," ; "a31,:" old=",i4," ; new=",i4," ;") end subroutine writereadgf @@ -534,8 +534,8 @@ subroutine fcn1( NGdof, xx, fvec, irevcm ) !-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-! -1000 format("fcn1 : ",f10.2," : "i9,i3," ; ":"|f|="es12.5" ; ":"time=",f10.2,"s ;":" log"a5"="28f6.2" ...") -1001 format("fcn1 : ", 10x ," : "9x,3x" ; ":" " 12x " ":" ", 10x ," ;":" log"a5"="28f6.2" ...") +1000 format("fcn1 : ",f10.2," : ",i9,i3," ; ",:,"|f|=",es12.5," ; ",:,"time=",f10.2,"s ;",:" log",a5,"=",28f6.2," ...") +1001 format("fcn1 : ", 10x ," : ",9x,3x," ; ",:," ", 12x, " ",:," ", 10x ," ;",:" log",a5,"=",28f6.2," ...") !-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-! @@ -727,8 +727,8 @@ subroutine fcn2( NGdof, xx, fvec, fjac, Ldfjac, irevcm ) !-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-! -1000 format("fcn2 : ",f10.2," : "i9,i3," ; ":"|f|="es12.5" ; ":"time=",f10.2,"s ;":" log"a5"="28f6.2" ...") -1001 format("fcn2 : ", 10x ," : "9x,3x" ; ":" " 12x " ":" ", 10x ," ;":" log"a5"="28f6.2" ...") +1000 format("fcn2 : ",f10.2," : ",i9,i3," ; ",:,"|f|=",es12.5," ; ",:,"time=",f10.2,"s ;",:" log",a5,"=",28f6.2," ...") +1001 format("fcn2 : ", 10x ," : ",9x,3x," ; ",:," ", 12x, " ",:," ", 10x ," ;",:" log",a5,"=",28f6.2," ...") !-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-! diff --git a/src/packab.f90 b/src/packab.f90 index b2b5ccc2..22d6f858 100644 --- a/src/packab.f90 +++ b/src/packab.f90 @@ -276,7 +276,7 @@ subroutine packab( packorunpack, lvol, NN, solution, ideriv ) endif ! end of if( Wpackab ); -1000 format("packab : " 10x " : myid="i3" ; lvol="i3" ; ("i3" ,"i3" ) : "a3"=["999(es23.15",")) +1000 format("packab : " 10x " : myid=",i3," ; lvol=",i3," ; ("i3" ,"i3" ) : "a3"=["999(es23.15",")) #endif diff --git a/src/pc00aa.f90 b/src/pc00aa.f90 index c79d1c27..b17e7159 100644 --- a/src/pc00aa.f90 +++ b/src/pc00aa.f90 @@ -79,7 +79,7 @@ subroutine pc00aa( NGdof, position, Nvol, mn, ie04dgf ) ! argument list is optio write(ounit,1000) cput-cpus, myid, NGdof, maxstep, maxiter, verify endif -1000 format("pc00aa : ",f10.2," : myid=",i3," ; calling E04DGF : NGdof="i6" ; maxstep="es10.2" ; maxiter="i9" ; verify=",i3," ;") +1000 format("pc00aa : ",f10.2," : myid=",i3," ; calling E04DGF : NGdof=",i6," ; maxstep=",es10.2," ; maxiter=",i9," ; verify=",i3," ;") !-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-! @@ -96,7 +96,7 @@ subroutine pc00aa( NGdof, position, Nvol, mn, ie04dgf ) ! argument list is optio ! if( myid.eq.0 ) then ! cput = GETTIME ! write(ounit,'("pc00aa : ", 10x ," : ")') -! write(ounit,'("pc00aa : ",f10.2," : iterations="2i8" ; "3x" ; Energy="es23.15" ; " 13x " ; ForceErr="es23.15" ;")') & +! write(ounit,'("pc00aa : ",f10.2," : iterations="2i8," ; "3x" ; Energy=",es23.15," ; " 13x " ; ForceErr=",es23.15," ;")') & ! cput-cpus, iuser(1:2), Energy, ForceErr ! endif ! @@ -124,7 +124,7 @@ subroutine pc00aa( NGdof, position, Nvol, mn, ie04dgf ) ! argument list is optio end select call E04DKF('Iteration Limit = 99999999') - write(smaxstep,'("Maximum Step Length ="es13.5)')maxstep + write(smaxstep,'("Maximum Step Length =",es13.5)')maxstep call E04DKF(smaxstep) !-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-! diff --git a/src/pc00ab.f90 b/src/pc00ab.f90 index b47907c0..f9df2031 100644 --- a/src/pc00ab.f90 +++ b/src/pc00ab.f90 @@ -216,7 +216,7 @@ subroutine pc00ab( mode, NGdof, Position, Energy, Gradient, nstate, iuser, ruser RETURN(pc00ab) -1000 format("pc00ab : ",f10.2," : iterations="2i8" ; mode=",i3," ; Energy="es23.15" ; |DF|="es13.5" ; ForceErr="es23.15" ;") +1000 format("pc00ab : ",f10.2," : iterations="2i8," ; mode=",i3," ; Energy=",es23.15," ; |DF|=",es13.5," ; ForceErr=",es23.15," ;") !-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-! diff --git a/src/pp00ab.f90 b/src/pp00ab.f90 index a4963797..e2d10a44 100644 --- a/src/pp00ab.f90 +++ b/src/pp00ab.f90 @@ -157,7 +157,7 @@ subroutine pp00ab( lvol, sti, Nz, nPpts, poincaredata, fittedtransform, utflag ) FATAL(pp00ab,.true.,illegal value of ifail returned from UT) end select -2001 format("pp00ab : ",f10.2," : myid=",i3," ; lvol=",i3," ; (jj,kk)=("i4" ,"i4" ); ifail="i2" ; "a63) +2001 format("pp00ab : ",f10.2," : myid=",i3," ; lvol=",i3," ; (jj,kk)=("i4" ,"i4" ); ifail=",i2," ; "a63) if( utflag.ne.1 ) exit ! an integration error was encountered; exit do kk loop; diff --git a/src/preset.f90 b/src/preset.f90 index 4ecd2e42..b9ec3330 100644 --- a/src/preset.f90 +++ b/src/preset.f90 @@ -115,7 +115,7 @@ subroutine preset endif -! if( myid.eq.0 ) write(ounit,'("global : " 10x " : "i3") im ="i3" , halfmm ="f5.1" , regum ="f5.1" ;")') ( ii, im(ii), halfmm(ii), regumm(ii), ii = 1, mn ) +! if( myid.eq.0 ) write(ounit,'("global : " 10x " : "i3,") im =",i3" , halfmm =",f5.1" , regum =",f5.1," ;")') ( ii, im(ii), halfmm(ii), regumm(ii), ii = 1, mn ) !-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-! @@ -915,7 +915,7 @@ subroutine preset if( myid.eq.0 ) then cput = GETTIME - write(ounit,'("preset : ",f10.2," : LBsequad="L2" , LBnewton="L2" , LBlinear="L2" ;")')cput-cpus, LBsequad, LBnewton, LBlinear + write(ounit,'("preset : ",f10.2," : LBsequad=",L2," , LBnewton=",L2," , LBlinear=",L2," ;")')cput-cpus, LBsequad, LBnewton, LBlinear endif !-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-! @@ -932,7 +932,7 @@ subroutine preset SALLOCATE( BBweight, (1:mn), opsilon * exp( - escale * ( im(1:mn)**2 + (in(1:mn)/Nfp)**2 ) ) ) if( myid.eq.0 .and. escale.gt.small ) then - do ii = 1, mn ; write(ounit,'("preset : " 10x " : myid="i3" ; ("i3","i3") : BBweight="es13.5" ;")') myid, im(ii), in(ii)/Nfp, BBweight(ii) + do ii = 1, mn ; write(ounit,'("preset : " 10x " : myid=",i3," ; ("i3","i3,") : BBweight=",es13.5," ;")') myid, im(ii), in(ii)/Nfp, BBweight(ii) enddo endif @@ -1233,19 +1233,19 @@ subroutine preset !if( Wpreset ) then ! do ii = 1, mn ! do ll = 0, Lrad(vvol) - ! write(ounit,'("preset : " 10x " : myid="i3" ; ii="i4" ; ll="i4" : Ate = "i7" ;")') myid, ii, ll, Ate(vvol,0,ii)%i(ll) - ! write(ounit,'("preset : " 10x " : myid="i3" ; ii="i4" ; ll="i4" : Aze = "i7" ;")') myid, ii, ll, Aze(vvol,0,ii)%i(ll) - ! write(ounit,'("preset : " 10x " : myid="i3" ; ii="i4" ; ll="i4" : Ato = "i7" ;")') myid, ii, ll, Ato(vvol,0,ii)%i(ll) - ! write(ounit,'("preset : " 10x " : myid="i3" ; ii="i4" ; ll="i4" : Azo = "i7" ;")') myid, ii, ll, Azo(vvol,0,ii)%i(ll) + ! write(ounit,'("preset : " 10x " : myid=",i3," ; ii=",i4," ; ll=",i4," : Ate = "i7," ;")') myid, ii, ll, Ate(vvol,0,ii)%i(ll) + ! write(ounit,'("preset : " 10x " : myid=",i3," ; ii=",i4," ; ll=",i4," : Aze = "i7," ;")') myid, ii, ll, Aze(vvol,0,ii)%i(ll) + ! write(ounit,'("preset : " 10x " : myid=",i3," ; ii=",i4," ; ll=",i4," : Ato = "i7," ;")') myid, ii, ll, Ato(vvol,0,ii)%i(ll) + ! write(ounit,'("preset : " 10x " : myid=",i3," ; ii=",i4," ; ll=",i4," : Azo = "i7," ;")') myid, ii, ll, Azo(vvol,0,ii)%i(ll) ! enddo - ! write(ounit,'("preset : " 10x " : myid="i3" ; ii="i4" ; "4x" : Lma = "i7" ;")') myid, ii, Lma(vvol, ii) - ! write(ounit,'("preset : " 10x " : myid="i3" ; ii="i4" ; "4x" : Lmb = "i7" ;")') myid, ii, Lmb(vvol, ii) - ! write(ounit,'("preset : " 10x " : myid="i3" ; ii="i4" ; "4x" : Lmc = "i7" ;")') myid, ii, Lmc(vvol, ii) - ! write(ounit,'("preset : " 10x " : myid="i3" ; ii="i4" ; "4x" : Lmd = "i7" ;")') myid, ii, Lmd(vvol, ii) - ! write(ounit,'("preset : " 10x " : myid="i3" ; ii="i4" ; "4x" : Lme = "i7" ;")') myid, ii, Lme(vvol, ii) - ! write(ounit,'("preset : " 10x " : myid="i3" ; ii="i4" ; "4x" : Lmf = "i7" ;")') myid, ii, Lmf(vvol, ii) - ! write(ounit,'("preset : " 10x " : myid="i3" ; ii="i4" ; "4x" : Lmg = "i7" ;")') myid, ii, Lmg(vvol, ii) - ! write(ounit,'("preset : " 10x " : myid="i3" ; ii="i4" ; "4x" : Lmh = "i7" ;")') myid, ii, Lmh(vvol, ii) + ! write(ounit,'("preset : " 10x " : myid=",i3," ; ii=",i4," ; "4x" : Lma = "i7," ;")') myid, ii, Lma(vvol, ii) + ! write(ounit,'("preset : " 10x " : myid=",i3," ; ii=",i4," ; "4x" : Lmb = "i7," ;")') myid, ii, Lmb(vvol, ii) + ! write(ounit,'("preset : " 10x " : myid=",i3," ; ii=",i4," ; "4x" : Lmc = "i7," ;")') myid, ii, Lmc(vvol, ii) + ! write(ounit,'("preset : " 10x " : myid=",i3," ; ii=",i4," ; "4x" : Lmd = "i7," ;")') myid, ii, Lmd(vvol, ii) + ! write(ounit,'("preset : " 10x " : myid=",i3," ; ii=",i4," ; "4x" : Lme = "i7," ;")') myid, ii, Lme(vvol, ii) + ! write(ounit,'("preset : " 10x " : myid=",i3," ; ii=",i4," ; "4x" : Lmf = "i7," ;")') myid, ii, Lmf(vvol, ii) + ! write(ounit,'("preset : " 10x " : myid=",i3," ; ii=",i4," ; "4x" : Lmg = "i7," ;")') myid, ii, Lmg(vvol, ii) + ! write(ounit,'("preset : " 10x " : myid=",i3," ; ii=",i4," ; "4x" : Lmh = "i7," ;")') myid, ii, Lmh(vvol, ii) ! enddo !endif @@ -1280,7 +1280,7 @@ subroutine preset if( myid.eq.0 ) then ! 17 Oct 12; cput = GETTIME write(ounit,'("preset : ", 10x ," : ")') - write(ounit,'("preset : ",f10.2," : Nquad="i4" ; mn="i5" ; NGdof="i6" ; NAdof="16(i6",")" ...")') cput-cpus, Nquad, mn, NGdof, NAdof(1:min(Mvol,16)) + write(ounit,'("preset : ",f10.2," : Nquad=",i4," ; mn=",i5," ; NGdof=",i6," ; NAdof=",16(i6,",")," ...")') cput-cpus, Nquad, mn, NGdof, NAdof(1:min(Mvol,16)) endif !-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-! @@ -1299,7 +1299,7 @@ subroutine preset if( myid.eq.0 ) then ! 17 Oct 12; cput = GETTIME write(ounit,'("preset : ", 10x ," : ")') - write(ounit,'("preset : ",f10.2," : Nt="i6" ; Nz="i6" ; Ntz="i9" ;")') cput-cpus, Nt, Nz, Ntz + write(ounit,'("preset : ",f10.2," : Nt=",i6," ; Nz=",i6," ; Ntz=",i9," ;")') cput-cpus, Nt, Nz, Ntz endif SALLOCATE( iRij, (1:Ntz,0:Mvol), zero ) ! interface geometry in real space; ! 18 Jul 14; @@ -1457,7 +1457,7 @@ subroutine preset if( abs(efmn(ii))+abs(ofmn(ii))+abs(cfmn(ii))+abs(sfmn(ii)).gt.small ) write(ounit,2000) mm, nn, im(ii), in(ii), efmn(ii), ofmn(ii), cfmn(ii), sfmn(ii) -2000 format("preset : ",10x," : (",i3,",",i3," ) = (",i3,",",i3," ) : "2f15.5" ; "2f15.5" ;") +2000 format("preset : ",10x," : (",i3,",",i3," ) = (",i3,",",i3," ) : "2f15.5," ; "2f15.5," ;") enddo ! end of do ii; SRH: 27 Feb 18; diff --git a/src/tr00ab.f90 b/src/tr00ab.f90 index 260f19ce..b72ccd68 100644 --- a/src/tr00ab.f90 +++ b/src/tr00ab.f90 @@ -456,7 +456,7 @@ subroutine tr00ab( lvol, mn, NN, Nt, Nz, iflag, ldiota ) ! construct straight-fi case default ; FATAL( tr00ab, .true., illegal ifail returned by F11ZAF ) end select -1000 format("tr00ab : ", 10x ," : myid=",i3," ; lvol=",i3," ; innout="i2" ; ideriv="i2" ; if11zaf="i2" ; time="f10.4" ; "a22) +1000 format("tr00ab : ", 10x ," : myid=",i3," ; lvol=",i3," ; innout=",i2," ; ideriv=",i2," ; if11zaf=",i2," ; time=",f10.4," ; "a22) enddo ! end of do ideriv; 23 Apr 13; @@ -520,7 +520,7 @@ subroutine tr00ab( lvol, mn, NN, Nt, Nz, iflag, ldiota ) ! construct straight-fi case( 3 ) ; write(ounit,1015) myid, lvol, innout, id, if11xaf, "input error ;" case default ; FATAL( tr00ab, .true., illegal ifail returned from F11XAF ) end select -1015 format("tr00ab : ", 10x ," : myid=",i3," ; lvol=",i3," ; innout="i2" ; ideriv="i2" ; if11xaf="i2" ; "10x" ; "a13) +1015 format("tr00ab : ", 10x ," : myid=",i3," ; lvol=",i3," ; innout=",i2," ; ideriv=",i2," ; if11xaf=",i2," ; "10x" ; "a13) srhs(1:Ndof,id) = srhs(1:Ndof,id) - srhs(1:Ndof,-1) endif ! end of if( Lsparse.ge.2. ) ; 24 Apr 13; case default @@ -546,8 +546,8 @@ subroutine tr00ab( lvol, mn, NN, Nt, Nz, iflag, ldiota ) ! construct straight-fi case( 6 ) ; write(ounit,1020) cput-cpus, myid, lvol, innout, id, if11def, cput-lcpu, "serious error ; ", zero , reqdits, rnorm case default ; FATAL( tr00ab, .true., illegal ifail returned by f11def ) end select -1020 format("tr00ab : ",f10.2," ; myid=",i3," ; lvol=",i3," ; innout="i2" ; ideriv="i2" ; if11def="i2" ; time="f10.4" ; "a17,:" [d]iota="es17.09& -" ; its="i6" rnorm="es13.5" ;") +1020 format("tr00ab : ",f10.2," ; myid=",i3," ; lvol=",i3," ; innout=",i2," ; ideriv=",i2," ; if11def=",i2," ; time=",f10.4," ; "a17,:" [d]iota=",es17.09& +" ; its=",i6" rnorm=",es13.5," ;") ldiota(innout,ideriv) = slambda(Ndof,id) ! return intent out; 23 Apr 13; glambda(1:Ndof,id,innout,lvol) = slambda(1:Ndof,id) ! save solution to use as initial guess; 21 Apr 13; @@ -566,7 +566,7 @@ subroutine tr00ab( lvol, mn, NN, Nt, Nz, iflag, ldiota ) ! construct straight-fi case( 3 ) ; write(ounit,1025) cput-cpus, myid, lvol, innout, id, if04atf, cput-lcpu, "input error ; " case default ; FATAL( tr00ab, .true., illegal ifail returned by f04atf ) end select -1025 format("tr00ab : ",f10.2," ; myid=",i3," ; lvol=",i3," ; innout="i2" ; ideriv="i2" ; if04atf="i2" ; time="f10.4" ; "a17,:" [d]iota="es17.09" ;") +1025 format("tr00ab : ",f10.2," ; myid=",i3," ; lvol=",i3," ; innout=",i2," ; ideriv=",i2," ; if04atf=",i2," ; time=",f10.4," ; "a17,:" [d]iota=",es17.09," ;") ldiota(innout,ideriv) = rlambda(Ndof,id) ! return intent out; 23 Apr 13; endif ! end of if( Lsparse.ge.2 ) ; 24 Apr 13; @@ -820,7 +820,7 @@ subroutine tr00ab( lvol, mn, NN, Nt, Nz, iflag, ldiota ) ! construct straight-fi end select ! end of select case( Lsvdiota ) ; 02 Sep 14; -1030 format("tr00ab : ",f10.2," ; myid=",i3," ; lvol=",i3," ; innout="i2" ; jderiv="i2" ; "a7"="i2" ; time="f10.4" ; "a17,:" [d]iota="es17.09" ;") +1030 format("tr00ab : ",f10.2," ; myid=",i3," ; lvol=",i3," ; innout=",i2," ; jderiv=",i2," ; "a7"=",i2," ; time=",f10.4," ; "a17,:" [d]iota=",es17.09," ;") !-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-! @@ -854,8 +854,8 @@ subroutine tr00ab( lvol, mn, NN, Nt, Nz, iflag, ldiota ) ! construct straight-fi endif ! end of if( Lsparse.eq.3 . . . ) ; 20 Apr 13; -2000 format("tr00ab : ",f10.2," : myid=",i3," ; lvol=",i3," ; innout="i2" ; ideriv="i2" ; "i2" ; compare ; if11def="i2" ; iota=["& - es18.10" ,"es18.10" ] ; err="es10.02" ;") +2000 format("tr00ab : ",f10.2," : myid=",i3," ; lvol=",i3," ; innout=",i2," ; ideriv=",i2," ; "i2," ; compare ; if11def=",i2," ; iota=["& + es18.10" ,"es18.10" ] ; err=",es10.02," ;") !-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-! diff --git a/src/volume.f90 b/src/volume.f90 index f7ce6a62..5adfb69c 100644 --- a/src/volume.f90 +++ b/src/volume.f90 @@ -306,7 +306,7 @@ subroutine volume( lvol, vflag ) if( Igeometry.eq.3 .and. lvol.eq.1 .and. innout.eq.0 ) write(ounit,1000) myid, vol(innout) * pi2pi2nfpquart * third if( Igeometry.eq.4 .and. lvol.eq.1 .and. innout.eq.0 ) write(ounit,1000) myid, vol(innout) * pi2pi2nfpquart * third endif -1000 format("volume : ", 10x ," : myid="i3" ; axis contribution to volume = ",es13.5," ;") +1000 format("volume : ", 10x ," : myid=",i3," ; axis contribution to volume = ",es13.5," ;") #endif enddo ! end of innout loop; 26 Feb 13; @@ -336,7 +336,7 @@ subroutine volume( lvol, vflag ) if( Wvolume ) then cput = GETTIME - write(ounit,'("volume : ",f10.2," : myid=",i3," ; Igeometry=",i2," ; vvolume(",i3," ) =",es23.15" ;")') cput-cpus, myid, Igeometry, lvol, vvolume(lvol) + write(ounit,'("volume : ",f10.2," : myid=",i3," ; Igeometry=",i2," ; vvolume(",i3," ) =",es23.15," ;")') cput-cpus, myid, Igeometry, lvol, vvolume(lvol) endif !-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-! diff --git a/src/wa00aa.f90 b/src/wa00aa.f90 index d76edf0a..ce6b7a0a 100644 --- a/src/wa00aa.f90 +++ b/src/wa00aa.f90 @@ -186,7 +186,7 @@ subroutine wa00aa( iwa00aa ) if( Wwa00aa ) then cput = GETTIME - do ii = 1, iwall ; write(ounit,'("wa00aa : ",f10.2," : Nsegments="i9" ; ii="i9" ; R="f15.9" ; Z="f15.9" ;")') cput-cpus, Nsegments, ii, xpoly(ii), ypoly(ii) + do ii = 1, iwall ; write(ounit,'("wa00aa : ",f10.2," : Nsegments=",i9," ; ii=",i9," ; R=",f15.9," ; Z=",f15.9," ;")') cput-cpus, Nsegments, ii, xpoly(ii), ypoly(ii) enddo endif @@ -209,9 +209,9 @@ subroutine wa00aa( iwa00aa ) cput = GETTIME ; ; write(ounit,'("wa00aa : ", 10x ," : ")') select case( ifail ) - case( 0 ) ; write(ounit,'("wa00aa : ",f10.2," : prepared vacuum calculation; stage1="L2" ; ifail=",i3," ; success ; ")') cput-cpus, stage1, ifail - case( 1 ) ; write(ounit,'("wa00aa : ",f10.2," : prepared vacuum calculation; stage1="L2" ; ifail=",i3," ; invalid tolerance ;")') cput-cpus, stage1, ifail - case( 2 ) ; write(ounit,'("wa00aa : ",f10.2," : prepared vacuum calculation; stage1="L2" ; ifail=",i3," ; incorrect rank ; ")') cput-cpus, stage1, ifail + case( 0 ) ; write(ounit,'("wa00aa : ",f10.2," : prepared vacuum calculation; stage1=",L2," ; ifail=",i3," ; success ; ")') cput-cpus, stage1, ifail + case( 1 ) ; write(ounit,'("wa00aa : ",f10.2," : prepared vacuum calculation; stage1=",L2," ; ifail=",i3," ; invalid tolerance ;")') cput-cpus, stage1, ifail + case( 2 ) ; write(ounit,'("wa00aa : ",f10.2," : prepared vacuum calculation; stage1=",L2," ; ifail=",i3," ; incorrect rank ; ")') cput-cpus, stage1, ifail case default FATAL( wa00aa, .true., invalid ifail returned by D03EAF ) end select @@ -240,12 +240,12 @@ subroutine wa00aa( iwa00aa ) cput = GETTIME select case( ifail ) - case( :-1 ) ; write(ounit,'("wa00aa : ",f10.2," : iangle="i6" ; ifail=",i3," ; outside domain ; FAIL ; ")') cput-cpus, iangle, ifail - case( 0 ) ; if( Wwa00aa ) write(ounit,'("wa00aa : ",f10.2," : iangle="i6" ; ifail=",i3," ; success ; ")') cput-cpus, iangle, ifail - case( 1 ) ; write(ounit,'("wa00aa : ",f10.2," : iangle="i6" ; ifail=",i3," ; input error ; FAIL ; ")') cput-cpus, iangle, ifail - case( 2 ) ; write(ounit,'("wa00aa : ",f10.2," : iangle="i6" ; ifail=",i3," ; consider restart ; FAIL ; ")') cput-cpus, iangle, ifail - case( 3 ) ; write(ounit,'("wa00aa : ",f10.2," : iangle="i6" ; ifail=",i3," ; xtol is too small ; FAIL ;")') cput-cpus, iangle, ifail - case( 4 ) ; write(ounit,'("wa00aa : ",f10.2," : iangle="i6" ; ifail=",i3," ; bad progress ; FAIL ; ")') cput-cpus, iangle, ifail + case( :-1 ) ; write(ounit,'("wa00aa : ",f10.2," : iangle=",i6," ; ifail=",i3," ; outside domain ; FAIL ; ")') cput-cpus, iangle, ifail + case( 0 ) ; if( Wwa00aa ) write(ounit,'("wa00aa : ",f10.2," : iangle=",i6," ; ifail=",i3," ; success ; ")') cput-cpus, iangle, ifail + case( 1 ) ; write(ounit,'("wa00aa : ",f10.2," : iangle=",i6," ; ifail=",i3," ; input error ; FAIL ; ")') cput-cpus, iangle, ifail + case( 2 ) ; write(ounit,'("wa00aa : ",f10.2," : iangle=",i6," ; ifail=",i3," ; consider restart ; FAIL ; ")') cput-cpus, iangle, ifail + case( 3 ) ; write(ounit,'("wa00aa : ",f10.2," : iangle=",i6," ; ifail=",i3," ; xtol is too small ; FAIL ;")') cput-cpus, iangle, ifail + case( 4 ) ; write(ounit,'("wa00aa : ",f10.2," : iangle=",i6," ; ifail=",i3," ; bad progress ; FAIL ; ")') cput-cpus, iangle, ifail case default FATAL( wa00aa, .true., invalid ifail returned by C05NBF ) end select @@ -344,9 +344,9 @@ subroutine VacuumPhi( Nconstraints, rho, fvec, iflag ) cput = GETTIME select case( ifail ) - case( 0 ) ; if( Wwa00aa ) write(ounit,'("wa00aa : ",f10.2," : stage1="L2" ; ifail=",i3," ; success ; ")') cput-cpus, stage1, ifail - case( 1 ) ; write(ounit,'("wa00aa : ",f10.2," : stage1="L2" ; ifail=",i3," ; invalid tolerance ;")') cput-cpus, stage1, ifail - case( 2 ) ; write(ounit,'("wa00aa : ",f10.2," : stage1="L2" ; ifail=",i3," ; incorrect rank ; ")') cput-cpus, stage1, ifail + case( 0 ) ; if( Wwa00aa ) write(ounit,'("wa00aa : ",f10.2," : stage1=",L2," ; ifail=",i3," ; success ; ")') cput-cpus, stage1, ifail + case( 1 ) ; write(ounit,'("wa00aa : ",f10.2," : stage1=",L2," ; ifail=",i3," ; invalid tolerance ;")') cput-cpus, stage1, ifail + case( 2 ) ; write(ounit,'("wa00aa : ",f10.2," : stage1=",L2," ; ifail=",i3," ; incorrect rank ; ")') cput-cpus, stage1, ifail case default FATAL( wa00aa, .true., invalid ifail returned by D03EAF ) end select @@ -362,7 +362,7 @@ subroutine VacuumPhi( Nconstraints, rho, fvec, iflag ) write(ounit,1000)iangle, niterations, rho(1), px, py, alpha, fvec(1) endif -1000 format("wa00aa : ", 10x ," : iangle="i6" ; nits=",i3," ; rho="es13.5" ; R,Z="2es23.15" ; alpha="es13.5" ; F="es13.5" ;") +1000 format("wa00aa : ", 10x ," : iangle=",i6," ; nits=",i3," ; rho=",es13.5," ; R,Z="2es23.15," ; alpha=",es13.5," ; F=",es13.5," ;") !-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-! diff --git a/src/xspech.f90 b/src/xspech.f90 index 03b3a9e2..5c4305c6 100644 --- a/src/xspech.f90 +++ b/src/xspech.f90 @@ -177,14 +177,14 @@ subroutine xspech if (myid.eq.0) then cput = GETTIME write(ounit,'("xspech : ", 10x ," :")') - write(ounit,'("xspech : ",f10.2," : myid=",i3," : time="f8.2"m = "f6.2"h = "f5.2"d ;")') cput-cpus, myid, (cput-cpus) / (/ 60, 60*60, 24*60*60 /) + write(ounit,'("xspech : ",f10.2," : myid=",i3," : time=",f8.2"m = "f6.2"h = "f5.2"d ;")') cput-cpus, myid, (cput-cpus) / (/ 60, 60*60, 24*60*60 /) endif MPIFINALIZE stop -1000 format("xspech : ",f10.2," : date="a4"/"a2"/"a2" , "a2":"a2":"a2" ; machine precision="es9.2" ; vsmall="es9.2" ; small="es9.2" ;") +1000 format("xspech : ",f10.2," : date="a4"/"a2"/"a2" , "a2":"a2":"a2," ; machine precision=",es9.2," ; vsmall=",es9.2," ; small=",es9.2," ;") end subroutine xspech @@ -553,8 +553,8 @@ subroutine spec endif endif -1000 format("xspech : ",f10.2," : #freeits=",i3," ; ":"|f|="es12.5" ; ":"time=",f10.2,"s ;":" log"a5,:"="28f6.2" ...") -1001 format("xspech : ", 10x ," : ",3x," ; ":" " 12x " ":" ", 10x ," ;":" log"a5,:"="28f6.2" ...") +1000 format("xspech : ",f10.2," : #freeits=",i3," ; ",:,"|f|=",es12.5," ; ",:,"time=",f10.2,"s ;",:" log",a5,:,"=",28f6.2," ...") +1001 format("xspech : ", 10x ," : ",3x," ; ",:," ", 12x, " ",:," ", 10x ," ;",:" log",a5,:,"=",28f6.2," ...") !-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-! @@ -755,8 +755,8 @@ subroutine spec ; ; write(ounit,1003) endif ! end of if( myid.eq.0 ) ; 24 Nov 16; -1003 format("xspech : " 10x " : ") -1004 format("xspech : "f10.2" : nfreeboundaryiterations = "i6" / "i6.5" ; gBntol ="es8.1" ; bnserr =",es12.5," ; bnorml time ="f10.2"s ;") +1003 format("xspech : ", 10x, " : ") +1004 format("xspech : ",f10.2," : nfreeboundaryiterations = ",i6," / ",i6.5," ; gBntol =",es8.1," ; bnserr =",es12.5," ; bnorml time =",f10.2,"s ;") endif ! end of if( LupdateBn ) ; @@ -859,7 +859,7 @@ subroutine final_diagnostics ! endif ! endif ! -!2000 format("finish : ",f10.2," : finished ",i3," ; ":"|f|="es12.5" ; ":"time=",f10.2,"s ;":" log"a5,:"="28f6.2" ...") +!2000 format("finish : ",f10.2," : finished ",i3," ; ":"|f|=",es12.5," ; ":"time=",f10.2,"s ;":" log"a5,:"="28f6.2" ...") !2001 format("finish : ", 10x ," : ",3x," ; ":" " 12x " ":" ", 10x ," ;":" log"a5,:"="28f6.2" ...") @@ -939,7 +939,7 @@ subroutine final_diagnostics if( nPpts.gt.0 ) then write(ounit,'("xspech : ", 10x ," :")') - write(ounit,'("xspech : ",f10.2," : myid=",i3," ; Poincare plot ; odetol="es8.1" ; nPpts="i7" ;":" nPtrj="24(i5",")" ...")') & + write(ounit,'("xspech : ",f10.2," : myid=",i3," ; Poincare plot ; odetol=",es8.1," ; nPpts=",i7," ;",:" nPtrj=",24(i5,",")," ...")') & cput-cpus, myid, odetol, nPpts, nPtrj(1:min(Mvol,24)) endif @@ -972,7 +972,7 @@ subroutine final_diagnostics call pp00aa() ! do Poincare plots in all volumes; has its own paralellization over volumes internally endif -1002 format("xspech : ",f10.2," :":" myid=",i3," ; vvol=",i3," ; IBeltrami="L2" ; construction of Beltrami field failed ;") +1002 format("xspech : ",f10.2," :":" myid=",i3," ; vvol=",i3," ; IBeltrami=",L2," ; construction of Beltrami field failed ;") !-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-! @@ -1052,8 +1052,8 @@ subroutine ending write(ounit,'("ending : ", 10x ," : ")') endif ! end of if( myid.eq.0 ) ; 14 Jan 15; -1000 format("ending : ",f10.2," : myid=",i3," ; completion ; time=",f10.2,"s = "f8.2"m = "f6.2"h = "f5.2"d ; date= "& - a4"/"a2"/"a2" ; time= "a2":"a2":"a2" ; ext = "a60) +1000 format("ending : ",f10.2," : myid=",i3," ; completion ; time=",f10.2,"s = ",f8.2,"m = ",f6.2,"h = ",f5.2,"d ; date= ",& + a4,"/",a2,"/",a2," ; time= ",a2,":",a2,":",a2," ; ext = ",a60) end subroutine ending From 75f74a45adc5e65b8a612cc92807d330832e5f36 Mon Sep 17 00:00:00 2001 From: Chris Date: Mon, 2 Mar 2026 17:09:02 +0100 Subject: [PATCH 6/6] two more bad strings --- src/mp00ac.f90 | 2 +- src/preset.f90 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mp00ac.f90 b/src/mp00ac.f90 index 34eb5a03..d9ff611b 100644 --- a/src/mp00ac.f90 +++ b/src/mp00ac.f90 @@ -414,7 +414,7 @@ subroutine mp00ac( Ndof, Xdof, Fdof, Ddof, Ldfjac, iflag ) ! argument list is fi ; write(ounit,1010) cput-cpus, myid, lvol, ideriv, "idgetrf idgetrs idgerfs", idgetrf(ideriv), idgetrs(ideriv), idgetrf(ideriv), "invalid error ; " endif - 1010 format("mp00ac : ",f10.2," : myid=",i3," ; lvol=",i3," ; ideriv=",i2," ; "a23"=",i3,' ',i3,' ',i3," ; "a34,:" time=",f10.2," ;") + 1010 format("mp00ac : ",f10.2," : myid=",i3," ; lvol=",i3," ; ideriv=",i2," ; ",a23,"=",i3,' ',i3,' ',i3," ; ",a34,:" time=",f10.2," ;") !-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-! diff --git a/src/preset.f90 b/src/preset.f90 index b9ec3330..35e75903 100644 --- a/src/preset.f90 +++ b/src/preset.f90 @@ -230,7 +230,7 @@ subroutine preset else ; Lchangeangle = .false. endif - if( Lchangeangle ) write(ounit,'("readin : " 10x " : CHANGING ANGLE ;")') + if( Lchangeangle ) write(ounit,'("readin : " ,10x, " : CHANGING ANGLE ;")') do ii = 1, mn ; mm = im(ii) ; nn = in(ii) / Nfp ! set plasma boundary, computational boundary; 29 Apr 15;