From 2027ba2ee7952c0fe6268df84ab3624525b0d7f7 Mon Sep 17 00:00:00 2001 From: Norwid Behrnd Date: Sun, 6 Aug 2023 18:35:32 +0200 Subject: [PATCH 01/13] provide a format definition for fprettify To ease a consistent representation of the code, a style sheet for fprettify was added. Signed-off-by: Norwid Behrnd --- fprettify.rc | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 fprettify.rc diff --git a/fprettify.rc b/fprettify.rc new file mode 100644 index 00000000..72cb1732 --- /dev/null +++ b/fprettify.rc @@ -0,0 +1,45 @@ +# Configuration file for work of fprettify on source code. +# +# This file determines how to maintain white space, indentations, use of +# upper/lower case. Though some of them represent default levels of the +# linter's parameters (as by version 0.3.7), all of them are compiled in +# the program's sequence when requesting help by `./fprettify -h`. The +# style is applied by +# +# ```shell +# fprettify -c ./fprettify.rc source.f90 +# ``` +# +# to overwrite the old form of file `source.f90`. +# +# The constraint of 80 characters per line was set to ease visual access +# of ford's multicolumn html, reading git logs/check changes by vimdiff. + +indent=3 +line-length=80 +whitespace=2 +whitespace-comma=True +whitespace-assignment=True + +# Control whitespace around '::' declarations +whitespace-decl=True +enable-decl=False + +whitespace-relational=True +whitespace-logical=True +whitespace-plusminus=True +whitespace-multdiv=False +whitespace-print=True + +whitespace-type=False +whitespace-intrinsics=True +strict-indent=True +enable-replacements=False +c-relations=False + +case=[1,1,1,1] +strip-comments=False +disable-fypp=False +disable-indent-mod=False + +# END From 574ddab55bff8b4eee44db675b9e1e980ca2ffd3 Mon Sep 17 00:00:00 2001 From: Norwid Behrnd Date: Sun, 6 Aug 2023 18:39:22 +0200 Subject: [PATCH 02/13] apply style on example1.f90 Signed-off-by: Norwid Behrnd --- example/example1.f90 | 41 +++++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/example/example1.f90 b/example/example1.f90 index f311832a..cda9bf39 100644 --- a/example/example1.f90 +++ b/example/example1.f90 @@ -1,27 +1,28 @@ program example1 - use forimage, only: format_pnm - implicit none - - type(format_pnm) :: ex1 - integer, dimension(10,6) :: px + use forimage, only: format_pnm + implicit none - px(1,:) = [0,0,0,0,1,0] - px(2,:) = [0,0,0,0,1,0] - px(3,:) = [0,0,0,0,1,0] - px(4,:) = [0,0,0,0,1,0] - px(5,:) = [0,0,0,0,1,0] - px(6,:) = [0,0,0,0,1,0] - px(7,:) = [1,0,0,0,1,0] - px(8,:) = [0,1,1,1,0,0] - px(9,:) = [0,0,0,0,0,0] - px(10,:) = [0,0,0,0,0,0] + type(format_pnm) :: ex1 + integer, dimension(10, 6) :: px - call ex1%set_pnm(encoding='ascii', file_format='pbm', width=10, height=6, comment='example 1', pixels=px) - call ex1%export_pnm('pnm_files/example1') + px(1, :) = [0, 0, 0, 0, 1, 0] + px(2, :) = [0, 0, 0, 0, 1, 0] + px(3, :) = [0, 0, 0, 0, 1, 0] + px(4, :) = [0, 0, 0, 0, 1, 0] + px(5, :) = [0, 0, 0, 0, 1, 0] + px(6, :) = [0, 0, 0, 0, 1, 0] + px(7, :) = [1, 0, 0, 0, 1, 0] + px(8, :) = [0, 1, 1, 1, 0, 0] + px(9, :) = [0, 0, 0, 0, 0, 0] + px(10, :) = [0, 0, 0, 0, 0, 0] - call ex1%import_pnm('pnm_files/example1','pbm','ascii') - call ex1%export_pnm('pnm_files/example1_ex') + call ex1%set_pnm(encoding='ascii', file_format='pbm', width=10, & + height=6, comment='example 1', pixels=px) + call ex1%export_pnm('pnm_files/example1') - call ex1%dlloc() + call ex1%import_pnm('pnm_files/example1', 'pbm', 'ascii') + call ex1%export_pnm('pnm_files/example1_ex') + + call ex1%dlloc() end program example1 From b9bbb8d4de06f5b7ceb783ce777738c8081be251 Mon Sep 17 00:00:00 2001 From: Norwid Behrnd Date: Sun, 6 Aug 2023 18:41:09 +0200 Subject: [PATCH 03/13] apply style on example2.f90 Signed-off-by: Norwid Behrnd --- example/example2.f90 | 7225 +++++++++++++++++++++--------------------- 1 file changed, 3613 insertions(+), 3612 deletions(-) diff --git a/example/example2.f90 b/example/example2.f90 index b7dcc58f..070a3ac6 100644 --- a/example/example2.f90 +++ b/example/example2.f90 @@ -1,3619 +1,3620 @@ program example2 - use forimage, only: format_pnm - implicit none - - type(format_pnm) :: ex2 - integer, dimension(60,60) :: px + use forimage, only: format_pnm + implicit none - px = transpose(reshape(& - [255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 242,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 251,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 242,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 251,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 242,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 251,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 242,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 251,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 242,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 251,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 242,& - 0,& - 0,& - 0,& - 0,& - 0,& - 119,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 242,& - 0,& - 0,& - 0,& - 0,& - 0,& - 119,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 242,& - 0,& - 0,& - 0,& - 0,& - 0,& - 119,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 242,& - 0,& - 0,& - 0,& - 0,& - 0,& - 119,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 242,& - 0,& - 0,& - 0,& - 0,& - 0,& - 119,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 242,& - 0,& - 0,& - 0,& - 0,& - 0,& - 119,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 242,& - 0,& - 0,& - 0,& - 0,& - 0,& - 119,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 242,& - 0,& - 0,& - 0,& - 0,& - 0,& - 119,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 242,& - 0,& - 0,& - 0,& - 0,& - 0,& - 119,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 242,& - 0,& - 0,& - 0,& - 0,& - 0,& - 119,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 242,& - 0,& - 0,& - 0,& - 0,& - 0,& - 119,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 242,& - 0,& - 0,& - 0,& - 0,& - 0,& - 119,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 242,& - 0,& - 0,& - 0,& - 0,& - 0,& - 119,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 242,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 237,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 242,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 237,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 242,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 237,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 242,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 237,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 242,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 0,& - 237,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 242,& - 0,& - 0,& - 0,& - 0,& - 0,& - 119,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 242,& - 0,& - 0,& - 0,& - 0,& - 0,& - 119,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 242,& - 0,& - 0,& - 0,& - 0,& - 0,& - 119,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 242,& - 0,& - 0,& - 0,& - 0,& - 0,& - 119,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 242,& - 0,& - 0,& - 0,& - 0,& - 0,& - 119,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 242,& - 0,& - 0,& - 0,& - 0,& - 0,& - 119,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 242,& - 0,& - 0,& - 0,& - 0,& - 0,& - 119,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 242,& - 0,& - 0,& - 0,& - 0,& - 0,& - 119,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 242,& - 0,& - 0,& - 0,& - 0,& - 0,& - 119,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 242,& - 0,& - 0,& - 0,& - 0,& - 0,& - 119,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 242,& - 0,& - 0,& - 0,& - 0,& - 0,& - 119,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 242,& - 0,& - 0,& - 0,& - 0,& - 0,& - 119,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 242,& - 0,& - 0,& - 0,& - 0,& - 0,& - 119,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 242,& - 0,& - 0,& - 0,& - 0,& - 0,& - 119,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 242,& - 0,& - 0,& - 0,& - 0,& - 0,& - 119,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 242,& - 0,& - 0,& - 0,& - 0,& - 0,& - 119,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 242,& - 0,& - 0,& - 0,& - 0,& - 0,& - 119,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 242,& - 0,& - 0,& - 0,& - 0,& - 0,& - 119,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 242,& - 0,& - 0,& - 0,& - 0,& - 0,& - 119,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 242,& - 0,& - 0,& - 0,& - 0,& - 0,& - 119,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 242,& - 0,& - 0,& - 0,& - 0,& - 0,& - 119,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255,& - 255]& - ,shape=shape(px))) + type(format_pnm) :: ex2 + integer, dimension(60, 60) :: px - call ex2%set_pnm(encoding='ascii', file_format='pgm', width=60, height=60, max_color=255, comment='example 2', pixels=px) - call ex2%export_pnm('pnm_files/example2') + px = transpose(reshape( & + [255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 242, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 251, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 242, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 251, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 242, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 251, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 242, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 251, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 242, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 251, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 242, & + 0, & + 0, & + 0, & + 0, & + 0, & + 119, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 242, & + 0, & + 0, & + 0, & + 0, & + 0, & + 119, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 242, & + 0, & + 0, & + 0, & + 0, & + 0, & + 119, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 242, & + 0, & + 0, & + 0, & + 0, & + 0, & + 119, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 242, & + 0, & + 0, & + 0, & + 0, & + 0, & + 119, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 242, & + 0, & + 0, & + 0, & + 0, & + 0, & + 119, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 242, & + 0, & + 0, & + 0, & + 0, & + 0, & + 119, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 242, & + 0, & + 0, & + 0, & + 0, & + 0, & + 119, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 242, & + 0, & + 0, & + 0, & + 0, & + 0, & + 119, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 242, & + 0, & + 0, & + 0, & + 0, & + 0, & + 119, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 242, & + 0, & + 0, & + 0, & + 0, & + 0, & + 119, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 242, & + 0, & + 0, & + 0, & + 0, & + 0, & + 119, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 242, & + 0, & + 0, & + 0, & + 0, & + 0, & + 119, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 242, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 237, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 242, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 237, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 242, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 237, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 242, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 237, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 242, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 0, & + 237, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 242, & + 0, & + 0, & + 0, & + 0, & + 0, & + 119, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 242, & + 0, & + 0, & + 0, & + 0, & + 0, & + 119, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 242, & + 0, & + 0, & + 0, & + 0, & + 0, & + 119, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 242, & + 0, & + 0, & + 0, & + 0, & + 0, & + 119, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 242, & + 0, & + 0, & + 0, & + 0, & + 0, & + 119, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 242, & + 0, & + 0, & + 0, & + 0, & + 0, & + 119, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 242, & + 0, & + 0, & + 0, & + 0, & + 0, & + 119, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 242, & + 0, & + 0, & + 0, & + 0, & + 0, & + 119, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 242, & + 0, & + 0, & + 0, & + 0, & + 0, & + 119, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 242, & + 0, & + 0, & + 0, & + 0, & + 0, & + 119, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 242, & + 0, & + 0, & + 0, & + 0, & + 0, & + 119, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 242, & + 0, & + 0, & + 0, & + 0, & + 0, & + 119, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 242, & + 0, & + 0, & + 0, & + 0, & + 0, & + 119, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 242, & + 0, & + 0, & + 0, & + 0, & + 0, & + 119, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 242, & + 0, & + 0, & + 0, & + 0, & + 0, & + 119, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 242, & + 0, & + 0, & + 0, & + 0, & + 0, & + 119, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 242, & + 0, & + 0, & + 0, & + 0, & + 0, & + 119, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 242, & + 0, & + 0, & + 0, & + 0, & + 0, & + 119, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 242, & + 0, & + 0, & + 0, & + 0, & + 0, & + 119, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 242, & + 0, & + 0, & + 0, & + 0, & + 0, & + 119, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 242, & + 0, & + 0, & + 0, & + 0, & + 0, & + 119, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255, & + 255] & + , shape=shape(px))) - call ex2%import_pnm('pnm_files/example2','pgm','ascii') - call ex2%export_pnm('pnm_files/example2_ex') + call ex2%set_pnm(encoding='ascii', file_format='pgm', width=60, & + height=60, max_color=255, comment='example 2', pixels=px) + call ex2%export_pnm('pnm_files/example2') - call ex2%dlloc() + call ex2%import_pnm('pnm_files/example2', 'pgm', 'ascii') + call ex2%export_pnm('pnm_files/example2_ex') + + call ex2%dlloc() end program example2 From 648be93dbc7adf298fde1a648c54ffe868487f63 Mon Sep 17 00:00:00 2001 From: Norwid Behrnd Date: Sun, 6 Aug 2023 18:42:16 +0200 Subject: [PATCH 04/13] apply style on example3.f90 Signed-off-by: Norwid Behrnd --- example/example3.f90 | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/example/example3.f90 b/example/example3.f90 index 1c204e30..5778f38e 100644 --- a/example/example3.f90 +++ b/example/example3.f90 @@ -1,21 +1,22 @@ program example3 - use forimage, only: format_pnm - implicit none - - type(format_pnm) :: ex3 - integer, dimension(4,12) :: px + use forimage, only: format_pnm + implicit none - px(1,:) = [0,0,0,0,0,0,0,0,0,15,0,15] - px(2,:) = [0,0,0,0,15,7,0,0,0,0,0,0] - px(3,:) = [0,0,0,0,0,0,0,15,7,0,0,0] - px(4,:) = [15,0,15,0,0,0,0,0,0,0,0,0] + type(format_pnm) :: ex3 + integer, dimension(4, 12) :: px - call ex3%set_pnm(encoding='ascii', file_format='ppm', width=4, height=4, max_color=15, comment='example 2', pixels=px) - call ex3%export_pnm('pnm_files/example3') + px(1, :) = [0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, 15] + px(2, :) = [0, 0, 0, 0, 15, 7, 0, 0, 0, 0, 0, 0] + px(3, :) = [0, 0, 0, 0, 0, 0, 0, 15, 7, 0, 0, 0] + px(4, :) = [15, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0] - call ex3%import_pnm('pnm_files/example3','ppm','ascii') - call ex3%export_pnm('pnm_files/example3_ex') + call ex3%set_pnm(encoding='ascii', file_format='ppm', width=4, height=4, & + max_color=15, comment='example 2', pixels=px) + call ex3%export_pnm('pnm_files/example3') - call ex3%dlloc() + call ex3%import_pnm('pnm_files/example3', 'ppm', 'ascii') + call ex3%export_pnm('pnm_files/example3_ex') + + call ex3%dlloc() end program example3 From bd14d3cb9c9bc8b05f6fc51611c2177f765aa037 Mon Sep 17 00:00:00 2001 From: Norwid Behrnd Date: Sun, 6 Aug 2023 18:43:43 +0200 Subject: [PATCH 05/13] apply style on forimage.f90, intermediate The implmentation of the style requires a couple of manual edits fprettify can not provide. This commit saves an intermediate. Signed-off-by: Norwid Behrnd --- src/forimage.f90 | 144 +++++++++++++++++++++-------------------------- 1 file changed, 65 insertions(+), 79 deletions(-) diff --git a/src/forimage.f90 b/src/forimage.f90 index aa940505..8c5aeb13 100644 --- a/src/forimage.f90 +++ b/src/forimage.f90 @@ -1,7 +1,7 @@ module forimage implicit none - + private public format_pnm @@ -12,7 +12,7 @@ module forimage integer :: height character(70) :: comment integer :: max_color - integer, dimension(:,:), allocatable :: pixels + integer, dimension(:, :), allocatable :: pixels character(3) :: file_format character(5) :: encoding contains @@ -38,34 +38,31 @@ module forimage !=============================================================================== !> author: Seyed Ali Ghasemi elemental pure subroutine set_file_format(this, file_format) - class(format_pnm), intent(inout) :: this - character(3), intent(in) :: file_format + class(format_pnm), intent(inout) :: this + character(3), intent(in) :: file_format - this%file_format = file_format + this%file_format = file_format end subroutine set_file_format !=============================================================================== - !=============================================================================== !> author: Seyed Ali Ghasemi elemental pure subroutine set_format(this, encoding) - class(format_pnm), intent(inout) :: this - character(*), intent(in) :: encoding + class(format_pnm), intent(inout) :: this + character(*), intent(in) :: encoding - this%encoding = encoding + this%encoding = encoding end subroutine set_format !=============================================================================== - !=============================================================================== !> author: Seyed Ali Ghasemi elemental pure subroutine deallocate_pnm(this) class(format_pnm), intent(inout) :: this - if (allocated(this%pixels)) deallocate(this%pixels) + if (allocated(this%pixels)) deallocate (this%pixels) end subroutine deallocate_pnm !=============================================================================== - !=============================================================================== !> author: Seyed Ali Ghasemi impure subroutine import_pnm(this, file_name, file_format, encoding) @@ -80,9 +77,9 @@ impure subroutine import_pnm(this, file_name, file_format, encoding) this%encoding = encoding select case (encoding) - case ('binary','raw') - - print*, 'Error: not implementet yet!' + case ('binary', 'raw') + + print *, 'Error: not implementet yet!' select case (file_format) case ('pbm') @@ -93,41 +90,41 @@ impure subroutine import_pnm(this, file_name, file_format, encoding) end select - case ('ascii','plain') + case ('ascii', 'plain') select case (file_format) case ('pbm') - open (newunit = nunit, file = file_name//'.'//file_format) - read(nunit,*) this%magic_number - read(nunit,*) temp,this%comment - read(nunit,*) this%width, this%height + open (newunit=nunit, file=file_name//'.'//file_format) + read (nunit, *) this%magic_number + read (nunit, *) temp, this%comment + read (nunit, *) this%width, this%height call this%allocate_pixels() - do i = 1, size(this%pixels,1) - read(nunit, *) this%pixels(i,:) + do i = 1, size(this%pixels, 1) + read (nunit, *) this%pixels(i, :) end do - close(nunit) + close (nunit) case ('pgm') - open (newunit = nunit, file = file_name//'.'//file_format) - read(nunit,*) this%magic_number - read(nunit,*) temp,this%comment - read(nunit,*) this%width, this%height - read(nunit,*) this%max_color + open (newunit=nunit, file=file_name//'.'//file_format) + read (nunit, *) this%magic_number + read (nunit, *) temp, this%comment + read (nunit, *) this%width, this%height + read (nunit, *) this%max_color call this%allocate_pixels() - do i = 1, size(this%pixels,1) - read(nunit, *) this%pixels(i,:) + do i = 1, size(this%pixels, 1) + read (nunit, *) this%pixels(i, :) end do - close(nunit) + close (nunit) case ('ppm') - open (newunit = nunit, file = file_name//'.'//file_format) - read(nunit,*) this%magic_number - read(nunit,*) temp,this%comment - read(nunit,*) this%width, this%height - read(nunit,*) this%max_color + open (newunit=nunit, file=file_name//'.'//file_format) + read (nunit, *) this%magic_number + read (nunit, *) temp, this%comment + read (nunit, *) this%width, this%height + read (nunit, *) this%max_color call this%allocate_pixels() - do i = 1, size(this%pixels,1) - read(nunit, *) this%pixels(i,:) + do i = 1, size(this%pixels, 1) + read (nunit, *) this%pixels(i, :) end do - close(nunit) + close (nunit) end select end select @@ -135,7 +132,6 @@ impure subroutine import_pnm(this, file_name, file_format, encoding) end subroutine import_pnm !=============================================================================== - !=============================================================================== !> author: Seyed Ali Ghasemi pure subroutine set_pnm(this, encoding, file_format,width,height,max_color,comment,pixels) @@ -144,13 +140,13 @@ pure subroutine set_pnm(this, encoding, file_format,width,height,max_color,comme integer, intent(in) :: height character(*), intent(in) :: comment integer, optional, intent(in) :: max_color - integer, dimension(:,:), intent(in) :: pixels + integer, dimension(:, :), intent(in) :: pixels character(*), intent(in) :: encoding character(3), intent(in) :: file_format character(2) :: magic_number select case (encoding) - case ('ascii','plain') + case ('ascii', 'plain') select case (file_format) case ('pbm') magic_number = 'P1' @@ -159,7 +155,7 @@ pure subroutine set_pnm(this, encoding, file_format,width,height,max_color,comme case ('ppm') magic_number = 'P3' end select - case ('binary','raw') + case ('binary', 'raw') error stop 'Error: not implementet yet!' select case (file_format) case ('pbm') @@ -173,29 +169,27 @@ pure subroutine set_pnm(this, encoding, file_format,width,height,max_color,comme call this%set_format(encoding) call this%set_file_format(file_format) - call this%set_header(magic_number,width,height,comment,max_color) + call this%set_header(magic_number, width, height, comment, max_color) call this%allocate_pixels() call this%set_pixels(pixels) end subroutine set_pnm !=============================================================================== - !=============================================================================== !> author: Seyed Ali Ghasemi elemental pure subroutine allocate_pixels(this) class(format_pnm), intent(inout) :: this - select case(this%magic_number) - case('P1') - if (.not.allocated(this%pixels)) allocate(this%pixels(this%height, this%width)) - case('P2') - if (.not.allocated(this%pixels)) allocate(this%pixels(this%height, this%width)) - case('P3') + select case (this%magic_number) + case ('P1') + if (.not.allocated(this%pixels)) allocate(this%pixels(this%height, this%width)) + case ('P2') + if (.not.allocated(this%pixels)) allocate(this%pixels(this%height, this%width)) + case ('P3') if (.not.allocated(this%pixels)) allocate(this%pixels(this%height, 3*this%width)) end select end subroutine allocate_pixels !=============================================================================== - !=============================================================================== !> author: Seyed Ali Ghasemi elemental pure subroutine set_magicnumber(this, magic_number) @@ -205,7 +199,6 @@ elemental pure subroutine set_magicnumber(this, magic_number) end subroutine set_magicnumber !=============================================================================== - !=============================================================================== !> author: Seyed Ali Ghasemi elemental pure subroutine set_width(this, width) @@ -215,7 +208,6 @@ elemental pure subroutine set_width(this, width) end subroutine set_width !=============================================================================== - !=============================================================================== !> author: Seyed Ali Ghasemi elemental pure subroutine set_height(this, height) @@ -225,7 +217,6 @@ elemental pure subroutine set_height(this, height) end subroutine set_height !=============================================================================== - !=============================================================================== !> author: Seyed Ali Ghasemi elemental pure subroutine set_comment(this, comment) @@ -235,7 +226,6 @@ elemental pure subroutine set_comment(this, comment) end subroutine set_comment !=============================================================================== - !=============================================================================== !> author: Seyed Ali Ghasemi elemental pure subroutine set_max_color(this, max_color) @@ -245,7 +235,6 @@ elemental pure subroutine set_max_color(this, max_color) end subroutine set_max_color !=============================================================================== - !=============================================================================== !> author: Seyed Ali Ghasemi elemental pure subroutine set_header(this, magic_number, width, height, comment, max_color) @@ -264,38 +253,35 @@ elemental pure subroutine set_header(this, magic_number, width, height, comment, end subroutine set_header !=============================================================================== - !=============================================================================== !> author: Seyed Ali Ghasemi pure subroutine set_pixels(this, pixels) class(format_pnm), intent(inout) :: this - integer, dimension(:,:), intent(in) :: pixels + integer, dimension(:, :), intent(in) :: pixels this%pixels = pixels end subroutine set_pixels !=============================================================================== - !=============================================================================== !> author: Seyed Ali Ghasemi - elemental pure subroutine set_pixel(this, grey,r,g,b, i, j) + elemental pure subroutine set_pixel(this, grey, r, g, b, i, j) class(format_pnm), intent(inout) :: this integer, intent(in), optional :: grey integer, intent(in), optional :: r, g, b integer, intent(in) :: i, j - select case(this%magic_number) - case('P1') - this%pixels(i,j) = grey - case('P2') - this%pixels(i,j) = grey - case('P3') - this%pixels(i,3*j-2) = r - this%pixels(i,3*j-1) = g - this%pixels(i,3*j-0) = b + select case (this%magic_number) + case ('P1') + this%pixels(i, j) = grey + case ('P2') + this%pixels(i, j) = grey + case ('P3') + this%pixels(i, 3*j - 2) = r + this%pixels(i, 3*j - 1) = g + this%pixels(i, 3*j - 0) = b end select end subroutine set_pixel !=============================================================================== - !=============================================================================== !> author: Seyed Ali Ghasemi impure subroutine export_pnm(this, file_name) @@ -303,15 +289,15 @@ impure subroutine export_pnm(this, file_name) character(*), intent(in) :: file_name integer :: nunit, i - open (newunit = nunit, file = file_name//'.'//this%file_format, status='replace') - write(nunit,'(a)') this%magic_number - write(nunit,'(a,a)') '# ',this%comment - write(nunit, '(g0,1x,g0)') this%width, this%height - if (this%file_format /= 'pbm') write(nunit,'(g0)') this%max_color - do i = 1, size(this%pixels,1) - write(nunit, '(*(g0,1x))') this%pixels(i,:) + open (newunit=nunit, file=file_name//'.'//this%file_format, status='replace') + write (nunit, '(a)') this%magic_number + write (nunit, '(a,a)') '# ', this%comment + write (nunit, '(g0,1x,g0)') this%width, this%height + if (this%file_format /= 'pbm') write (nunit, '(g0)') this%max_color + do i = 1, size(this%pixels, 1) + write (nunit, '(*(g0,1x))') this%pixels(i, :) end do - close(nunit) + close (nunit) end subroutine export_pnm !=============================================================================== From c02b7455fa6358e2c386fc9bd51e033e7719f9e4 Mon Sep 17 00:00:00 2001 From: Norwid Behrnd Date: Sun, 6 Aug 2023 18:47:33 +0200 Subject: [PATCH 06/13] adjust spaces around `::` Signed-off-by: Norwid Behrnd --- src/forimage.f90 | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/src/forimage.f90 b/src/forimage.f90 index 8c5aeb13..8d4204d1 100644 --- a/src/forimage.f90 +++ b/src/forimage.f90 @@ -7,14 +7,14 @@ module forimage !=============================================================================== type format_pnm - character(2) :: magic_number - integer :: width - integer :: height - character(70) :: comment - integer :: max_color + character(2) :: magic_number + integer :: width + integer :: height + character(70) :: comment + integer :: max_color integer, dimension(:, :), allocatable :: pixels - character(3) :: file_format - character(5) :: encoding + character(3) :: file_format + character(5) :: encoding contains procedure :: set_format procedure :: set_file_format @@ -135,15 +135,15 @@ end subroutine import_pnm !=============================================================================== !> author: Seyed Ali Ghasemi pure subroutine set_pnm(this, encoding, file_format,width,height,max_color,comment,pixels) - class(format_pnm), intent(inout) :: this - integer, intent(in) :: width - integer, intent(in) :: height - character(*), intent(in) :: comment - integer, optional, intent(in) :: max_color + class(format_pnm), intent(inout) :: this + integer, intent(in) :: width + integer, intent(in) :: height + character(*), intent(in) :: comment + integer, optional, intent(in) :: max_color integer, dimension(:, :), intent(in) :: pixels - character(*), intent(in) :: encoding - character(3), intent(in) :: file_format - character(2) :: magic_number + character(*), intent(in) :: encoding + character(3), intent(in) :: file_format + character(2) :: magic_number select case (encoding) case ('ascii', 'plain') @@ -243,7 +243,7 @@ elemental pure subroutine set_header(this, magic_number, width, height, comment, integer, intent(in) :: width integer, intent(in) :: height character(*), intent(in) :: comment - integer, optional, intent(in) :: max_color + integer, optional, intent(in) :: max_color call this%set_magicnumber(magic_number) call this%set_width(height) @@ -256,8 +256,8 @@ end subroutine set_header !=============================================================================== !> author: Seyed Ali Ghasemi pure subroutine set_pixels(this, pixels) - class(format_pnm), intent(inout) :: this - integer, dimension(:, :), intent(in) :: pixels + class(format_pnm), intent(inout) :: this + integer, dimension(:, :), intent(in) :: pixels this%pixels = pixels end subroutine set_pixels !=============================================================================== From 723115c8255af429126f63fd6e8716b2abdee531 Mon Sep 17 00:00:00 2001 From: Norwid Behrnd Date: Sun, 6 Aug 2023 18:57:59 +0200 Subject: [PATCH 07/13] use fprettify indentation By application of the fprettify style, fences of procedures now are dedented. Simultaneously, they stay within the 80 character/line limit. Signed-off-by: Norwid Behrnd --- src/forimage.f90 | 100 +++++++++++++++++++++++------------------------ 1 file changed, 50 insertions(+), 50 deletions(-) diff --git a/src/forimage.f90 b/src/forimage.f90 index 8d4204d1..780684a8 100644 --- a/src/forimage.f90 +++ b/src/forimage.f90 @@ -5,7 +5,7 @@ module forimage private public format_pnm - !=============================================================================== +!=============================================================================== type format_pnm character(2) :: magic_number integer :: width @@ -31,40 +31,40 @@ module forimage procedure :: import_pnm procedure :: dlloc => deallocate_pnm end type format_pnm - !=============================================================================== +!=============================================================================== contains - !=============================================================================== - !> author: Seyed Ali Ghasemi +!=============================================================================== +!> author: Seyed Ali Ghasemi elemental pure subroutine set_file_format(this, file_format) class(format_pnm), intent(inout) :: this character(3), intent(in) :: file_format this%file_format = file_format end subroutine set_file_format - !=============================================================================== +!=============================================================================== - !=============================================================================== - !> author: Seyed Ali Ghasemi +!=============================================================================== +!> author: Seyed Ali Ghasemi elemental pure subroutine set_format(this, encoding) class(format_pnm), intent(inout) :: this character(*), intent(in) :: encoding this%encoding = encoding end subroutine set_format - !=============================================================================== +!=============================================================================== - !=============================================================================== - !> author: Seyed Ali Ghasemi +!=============================================================================== +!> author: Seyed Ali Ghasemi elemental pure subroutine deallocate_pnm(this) class(format_pnm), intent(inout) :: this if (allocated(this%pixels)) deallocate (this%pixels) end subroutine deallocate_pnm - !=============================================================================== +!=============================================================================== - !=============================================================================== - !> author: Seyed Ali Ghasemi +!=============================================================================== +!> author: Seyed Ali Ghasemi impure subroutine import_pnm(this, file_name, file_format, encoding) class(format_pnm), intent(inout) :: this character(*), intent(in) :: file_name @@ -130,11 +130,11 @@ impure subroutine import_pnm(this, file_name, file_format, encoding) end select end subroutine import_pnm - !=============================================================================== +!=============================================================================== - !=============================================================================== - !> author: Seyed Ali Ghasemi - pure subroutine set_pnm(this, encoding, file_format,width,height,max_color,comment,pixels) +!=============================================================================== +!> author: Seyed Ali Ghasemi +pure subroutine set_pnm(this, encoding, file_format,width,height,max_color,comment,pixels) class(format_pnm), intent(inout) :: this integer, intent(in) :: width integer, intent(in) :: height @@ -173,10 +173,10 @@ pure subroutine set_pnm(this, encoding, file_format,width,height,max_color,comme call this%allocate_pixels() call this%set_pixels(pixels) end subroutine set_pnm - !=============================================================================== +!=============================================================================== - !=============================================================================== - !> author: Seyed Ali Ghasemi +!=============================================================================== +!> author: Seyed Ali Ghasemi elemental pure subroutine allocate_pixels(this) class(format_pnm), intent(inout) :: this select case (this%magic_number) @@ -185,59 +185,59 @@ elemental pure subroutine allocate_pixels(this) case ('P2') if (.not.allocated(this%pixels)) allocate(this%pixels(this%height, this%width)) case ('P3') - if (.not.allocated(this%pixels)) allocate(this%pixels(this%height, 3*this%width)) +if (.not.allocated(this%pixels)) allocate(this%pixels(this%height, 3*this%width)) end select end subroutine allocate_pixels - !=============================================================================== +!=============================================================================== - !=============================================================================== - !> author: Seyed Ali Ghasemi +!=============================================================================== +!> author: Seyed Ali Ghasemi elemental pure subroutine set_magicnumber(this, magic_number) class(format_pnm), intent(inout) :: this character(*), intent(in) :: magic_number this%magic_number = magic_number end subroutine set_magicnumber - !=============================================================================== +!=============================================================================== - !=============================================================================== - !> author: Seyed Ali Ghasemi +!=============================================================================== +!> author: Seyed Ali Ghasemi elemental pure subroutine set_width(this, width) class(format_pnm), intent(inout) :: this integer, intent(in) :: width this%width = width end subroutine set_width - !=============================================================================== +!=============================================================================== - !=============================================================================== - !> author: Seyed Ali Ghasemi +!=============================================================================== +!> author: Seyed Ali Ghasemi elemental pure subroutine set_height(this, height) class(format_pnm), intent(inout) :: this integer, intent(in) :: height this%height = height end subroutine set_height - !=============================================================================== +!=============================================================================== - !=============================================================================== - !> author: Seyed Ali Ghasemi +!=============================================================================== +!> author: Seyed Ali Ghasemi elemental pure subroutine set_comment(this, comment) class(format_pnm), intent(inout) :: this character(*), intent(in) :: comment this%comment = comment end subroutine set_comment - !=============================================================================== +!=============================================================================== - !=============================================================================== - !> author: Seyed Ali Ghasemi +!=============================================================================== +!> author: Seyed Ali Ghasemi elemental pure subroutine set_max_color(this, max_color) class(format_pnm), intent(inout) :: this integer, intent(in) :: max_color this%max_color = max_color end subroutine set_max_color - !=============================================================================== +!=============================================================================== - !=============================================================================== - !> author: Seyed Ali Ghasemi - elemental pure subroutine set_header(this, magic_number, width, height, comment, max_color) +!=============================================================================== +!> author: Seyed Ali Ghasemi +elemental pure subroutine set_header(this, magic_number, width, height, comment, max_color) class(format_pnm), intent(inout) :: this character(*), intent(in) :: magic_number integer, intent(in) :: width @@ -251,19 +251,19 @@ elemental pure subroutine set_header(this, magic_number, width, height, comment, call this%set_comment(comment) if (this%file_format /= 'pbm') call this%set_max_color(max_color) end subroutine set_header - !=============================================================================== +!=============================================================================== - !=============================================================================== - !> author: Seyed Ali Ghasemi +!=============================================================================== +!> author: Seyed Ali Ghasemi pure subroutine set_pixels(this, pixels) class(format_pnm), intent(inout) :: this integer, dimension(:, :), intent(in) :: pixels this%pixels = pixels end subroutine set_pixels - !=============================================================================== +!=============================================================================== - !=============================================================================== - !> author: Seyed Ali Ghasemi +!=============================================================================== +!> author: Seyed Ali Ghasemi elemental pure subroutine set_pixel(this, grey, r, g, b, i, j) class(format_pnm), intent(inout) :: this integer, intent(in), optional :: grey @@ -280,10 +280,10 @@ elemental pure subroutine set_pixel(this, grey, r, g, b, i, j) this%pixels(i, 3*j - 0) = b end select end subroutine set_pixel - !=============================================================================== +!=============================================================================== - !=============================================================================== - !> author: Seyed Ali Ghasemi +!=============================================================================== +!> author: Seyed Ali Ghasemi impure subroutine export_pnm(this, file_name) class(format_pnm), intent(inout) :: this character(*), intent(in) :: file_name @@ -299,6 +299,6 @@ impure subroutine export_pnm(this, file_name) end do close (nunit) end subroutine export_pnm - !=============================================================================== +!=============================================================================== end module forimage From d36ac808a6f3ac7b647d2330776a451c45e59360 Mon Sep 17 00:00:00 2001 From: Norwid Behrnd Date: Sun, 6 Aug 2023 19:08:32 +0200 Subject: [PATCH 08/13] end manual edits on style in forimage.f90 Manually, lines the fprettify style considered overly long are split with `&`. Eventually, all suggestions are considered, and `fpm build` still successfully works without report of an error. Signed-off-by: Norwid Behrnd --- src/forimage.f90 | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/forimage.f90 b/src/forimage.f90 index 780684a8..bc08be47 100644 --- a/src/forimage.f90 +++ b/src/forimage.f90 @@ -134,7 +134,8 @@ end subroutine import_pnm !=============================================================================== !> author: Seyed Ali Ghasemi -pure subroutine set_pnm(this, encoding, file_format,width,height,max_color,comment,pixels) + pure subroutine set_pnm(this, encoding, file_format, width, height, & + max_color, comment, pixels) class(format_pnm), intent(inout) :: this integer, intent(in) :: width integer, intent(in) :: height @@ -181,11 +182,14 @@ elemental pure subroutine allocate_pixels(this) class(format_pnm), intent(inout) :: this select case (this%magic_number) case ('P1') - if (.not.allocated(this%pixels)) allocate(this%pixels(this%height, this%width)) + if (.not. allocated(this%pixels)) allocate (this%pixels(this%height, & + this%width)) case ('P2') - if (.not.allocated(this%pixels)) allocate(this%pixels(this%height, this%width)) + if (.not. allocated(this%pixels)) allocate (this%pixels(this%height, & + this%width)) case ('P3') -if (.not.allocated(this%pixels)) allocate(this%pixels(this%height, 3*this%width)) + if (.not. allocated(this%pixels)) allocate (this%pixels(this%height, & + 3*this%width)) end select end subroutine allocate_pixels !=============================================================================== @@ -237,7 +241,8 @@ end subroutine set_max_color !=============================================================================== !> author: Seyed Ali Ghasemi -elemental pure subroutine set_header(this, magic_number, width, height, comment, max_color) + elemental pure subroutine set_header(this, magic_number, width, height, & + comment, max_color) class(format_pnm), intent(inout) :: this character(*), intent(in) :: magic_number integer, intent(in) :: width @@ -289,7 +294,8 @@ impure subroutine export_pnm(this, file_name) character(*), intent(in) :: file_name integer :: nunit, i - open (newunit=nunit, file=file_name//'.'//this%file_format, status='replace') + open (newunit=nunit, file=file_name//'.'//this%file_format, & + status='replace') write (nunit, '(a)') this%magic_number write (nunit, '(a,a)') '# ', this%comment write (nunit, '(g0,1x,g0)') this%width, this%height From 1a6407c924b010cc2e8722c266c8a834f3e5e268 Mon Sep 17 00:00:00 2001 From: Norwid Behrnd Date: Sun, 6 Aug 2023 19:14:49 +0200 Subject: [PATCH 09/13] sort procedure list in type definition The type definition now lists the procedures in an alphabetic sort. If ford's documentation is not accessed, then this place is the users' entry to get familiar with the procedures provided. Signed-off-by: Norwid Behrnd --- src/forimage.f90 | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/forimage.f90 b/src/forimage.f90 index bc08be47..8c908e9a 100644 --- a/src/forimage.f90 +++ b/src/forimage.f90 @@ -16,20 +16,20 @@ module forimage character(3) :: file_format character(5) :: encoding contains - procedure :: set_format + procedure :: allocate_pixels + procedure :: dlloc => deallocate_pnm + procedure :: export_pnm + procedure :: import_pnm + procedure :: set_comment procedure :: set_file_format - procedure :: set_magicnumber - procedure :: set_width + procedure :: set_format + procedure :: set_header procedure :: set_height - procedure :: set_comment + procedure :: set_magicnumber procedure :: set_max_color - procedure :: set_header - procedure :: allocate_pixels procedure :: set_pixels - procedure :: export_pnm procedure :: set_pnm - procedure :: import_pnm - procedure :: dlloc => deallocate_pnm + procedure :: set_width end type format_pnm !=============================================================================== From 08805c72222f90acd152c1d50200a32c7482ad43 Mon Sep 17 00:00:00 2001 From: Norwid Behrnd Date: Sun, 6 Aug 2023 19:20:56 +0200 Subject: [PATCH 10/13] start rearrange procedures To match the listing in the type block, the procedures equally are sort alphabetically. This work has started, still is incomplete. Signed-off-by: Norwid Behrnd --- src/forimage.f90 | 51 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/src/forimage.f90 b/src/forimage.f90 index 8c908e9a..78f93223 100644 --- a/src/forimage.f90 +++ b/src/forimage.f90 @@ -35,6 +35,57 @@ module forimage contains +!=============================================================================== +!> author: Seyed Ali Ghasemi + elemental pure subroutine allocate_pixels(this) + class(format_pnm), intent(inout) :: this + select case (this%magic_number) + case ('P1') + if (.not. allocated(this%pixels)) allocate (this%pixels(this%height, & + this%width)) + case ('P2') + if (.not. allocated(this%pixels)) allocate (this%pixels(this%height, & + this%width)) + case ('P3') + if (.not. allocated(this%pixels)) allocate (this%pixels(this%height, & + 3*this%width)) + end select + end subroutine allocate_pixels +!=============================================================================== + + +!=============================================================================== +!> author: Seyed Ali Ghasemi + elemental pure subroutine deallocate_pnm(this) + class(format_pnm), intent(inout) :: this + if (allocated(this%pixels)) deallocate (this%pixels) + end subroutine deallocate_pnm +!=============================================================================== + + +!=============================================================================== +!> author: Seyed Ali Ghasemi + impure subroutine export_pnm(this, file_name) + class(format_pnm), intent(inout) :: this + character(*), intent(in) :: file_name + integer :: nunit, i + + open (newunit=nunit, file=file_name//'.'//this%file_format, & + status='replace') + write (nunit, '(a)') this%magic_number + write (nunit, '(a,a)') '# ', this%comment + write (nunit, '(g0,1x,g0)') this%width, this%height + if (this%file_format /= 'pbm') write (nunit, '(g0)') this%max_color + do i = 1, size(this%pixels, 1) + write (nunit, '(*(g0,1x))') this%pixels(i, :) + end do + close (nunit) + end subroutine export_pnm +!=============================================================================== + + +! still unsort, start: + !=============================================================================== !> author: Seyed Ali Ghasemi elemental pure subroutine set_file_format(this, file_format) From 7e8db7e6d0905b6866c3730b37074da26f61e073 Mon Sep 17 00:00:00 2001 From: Norwid Behrnd Date: Mon, 7 Aug 2023 12:19:29 +0200 Subject: [PATCH 11/13] complete rearrangement of procedures The alphabetic sort of the procedures is complete. Their sequence matches the listing in the type block. Signed-off-by: Norwid Behrnd --- src/forimage.f90 | 226 ++++++++++++++++++----------------------------- 1 file changed, 84 insertions(+), 142 deletions(-) diff --git a/src/forimage.f90 b/src/forimage.f90 index 78f93223..653a9f4e 100644 --- a/src/forimage.f90 +++ b/src/forimage.f90 @@ -84,36 +84,6 @@ end subroutine export_pnm !=============================================================================== -! still unsort, start: - -!=============================================================================== -!> author: Seyed Ali Ghasemi - elemental pure subroutine set_file_format(this, file_format) - class(format_pnm), intent(inout) :: this - character(3), intent(in) :: file_format - - this%file_format = file_format - end subroutine set_file_format -!=============================================================================== - -!=============================================================================== -!> author: Seyed Ali Ghasemi - elemental pure subroutine set_format(this, encoding) - class(format_pnm), intent(inout) :: this - character(*), intent(in) :: encoding - - this%encoding = encoding - end subroutine set_format -!=============================================================================== - -!=============================================================================== -!> author: Seyed Ali Ghasemi - elemental pure subroutine deallocate_pnm(this) - class(format_pnm), intent(inout) :: this - if (allocated(this%pixels)) deallocate (this%pixels) - end subroutine deallocate_pnm -!=============================================================================== - !=============================================================================== !> author: Seyed Ali Ghasemi impure subroutine import_pnm(this, file_name, file_format, encoding) @@ -183,86 +153,59 @@ impure subroutine import_pnm(this, file_name, file_format, encoding) end subroutine import_pnm !=============================================================================== + !=============================================================================== !> author: Seyed Ali Ghasemi - pure subroutine set_pnm(this, encoding, file_format, width, height, & - max_color, comment, pixels) - class(format_pnm), intent(inout) :: this - integer, intent(in) :: width - integer, intent(in) :: height - character(*), intent(in) :: comment - integer, optional, intent(in) :: max_color - integer, dimension(:, :), intent(in) :: pixels - character(*), intent(in) :: encoding - character(3), intent(in) :: file_format - character(2) :: magic_number - - select case (encoding) - case ('ascii', 'plain') - select case (file_format) - case ('pbm') - magic_number = 'P1' - case ('pgm') - magic_number = 'P2' - case ('ppm') - magic_number = 'P3' - end select - case ('binary', 'raw') - error stop 'Error: not implementet yet!' - select case (file_format) - case ('pbm') - magic_number = 'P4' - case ('pgm') - magic_number = 'P5' - case ('ppm') - magic_number = 'P6' - end select - end select - - call this%set_format(encoding) - call this%set_file_format(file_format) - call this%set_header(magic_number, width, height, comment, max_color) - call this%allocate_pixels() - call this%set_pixels(pixels) - end subroutine set_pnm + elemental pure subroutine set_comment(this, comment) + class(format_pnm), intent(inout) :: this + character(*), intent(in) :: comment + this%comment = comment + end subroutine set_comment !=============================================================================== + !=============================================================================== !> author: Seyed Ali Ghasemi - elemental pure subroutine allocate_pixels(this) + elemental pure subroutine set_file_format(this, file_format) class(format_pnm), intent(inout) :: this - select case (this%magic_number) - case ('P1') - if (.not. allocated(this%pixels)) allocate (this%pixels(this%height, & - this%width)) - case ('P2') - if (.not. allocated(this%pixels)) allocate (this%pixels(this%height, & - this%width)) - case ('P3') - if (.not. allocated(this%pixels)) allocate (this%pixels(this%height, & - 3*this%width)) - end select - end subroutine allocate_pixels + character(3), intent(in) :: file_format + + this%file_format = file_format + end subroutine set_file_format !=============================================================================== + !=============================================================================== !> author: Seyed Ali Ghasemi - elemental pure subroutine set_magicnumber(this, magic_number) + elemental pure subroutine set_format(this, encoding) class(format_pnm), intent(inout) :: this - character(*), intent(in) :: magic_number - this%magic_number = magic_number - end subroutine set_magicnumber + character(*), intent(in) :: encoding + + this%encoding = encoding + end subroutine set_format !=============================================================================== + !=============================================================================== !> author: Seyed Ali Ghasemi - elemental pure subroutine set_width(this, width) + elemental pure subroutine set_header(this, magic_number, width, height, & + comment, max_color) class(format_pnm), intent(inout) :: this + character(*), intent(in) :: magic_number integer, intent(in) :: width - this%width = width - end subroutine set_width + integer, intent(in) :: height + character(*), intent(in) :: comment + integer, optional, intent(in) :: max_color + + call this%set_magicnumber(magic_number) + call this%set_width(height) + call this%set_height(width) + call this%set_comment(comment) + if (this%file_format /= 'pbm') call this%set_max_color(max_color) + end subroutine set_header !=============================================================================== + !=============================================================================== !> author: Seyed Ali Ghasemi elemental pure subroutine set_height(this, height) @@ -272,15 +215,17 @@ elemental pure subroutine set_height(this, height) end subroutine set_height !=============================================================================== + !=============================================================================== !> author: Seyed Ali Ghasemi - elemental pure subroutine set_comment(this, comment) + elemental pure subroutine set_magicnumber(this, magic_number) class(format_pnm), intent(inout) :: this - character(*), intent(in) :: comment - this%comment = comment - end subroutine set_comment + character(*), intent(in) :: magic_number + this%magic_number = magic_number + end subroutine set_magicnumber !=============================================================================== + !=============================================================================== !> author: Seyed Ali Ghasemi elemental pure subroutine set_max_color(this, max_color) @@ -290,24 +235,6 @@ elemental pure subroutine set_max_color(this, max_color) end subroutine set_max_color !=============================================================================== -!=============================================================================== -!> author: Seyed Ali Ghasemi - elemental pure subroutine set_header(this, magic_number, width, height, & - comment, max_color) - class(format_pnm), intent(inout) :: this - character(*), intent(in) :: magic_number - integer, intent(in) :: width - integer, intent(in) :: height - character(*), intent(in) :: comment - integer, optional, intent(in) :: max_color - - call this%set_magicnumber(magic_number) - call this%set_width(height) - call this%set_height(width) - call this%set_comment(comment) - if (this%file_format /= 'pbm') call this%set_max_color(max_color) - end subroutine set_header -!=============================================================================== !=============================================================================== !> author: Seyed Ali Ghasemi @@ -318,44 +245,59 @@ pure subroutine set_pixels(this, pixels) end subroutine set_pixels !=============================================================================== + !=============================================================================== !> author: Seyed Ali Ghasemi - elemental pure subroutine set_pixel(this, grey, r, g, b, i, j) - class(format_pnm), intent(inout) :: this - integer, intent(in), optional :: grey - integer, intent(in), optional :: r, g, b - integer, intent(in) :: i, j - select case (this%magic_number) - case ('P1') - this%pixels(i, j) = grey - case ('P2') - this%pixels(i, j) = grey - case ('P3') - this%pixels(i, 3*j - 2) = r - this%pixels(i, 3*j - 1) = g - this%pixels(i, 3*j - 0) = b + pure subroutine set_pnm(this, encoding, file_format, width, height, & + max_color, comment, pixels) + class(format_pnm), intent(inout) :: this + integer, intent(in) :: width + integer, intent(in) :: height + character(*), intent(in) :: comment + integer, optional, intent(in) :: max_color + integer, dimension(:, :), intent(in) :: pixels + character(*), intent(in) :: encoding + character(3), intent(in) :: file_format + character(2) :: magic_number + + select case (encoding) + case ('ascii', 'plain') + select case (file_format) + case ('pbm') + magic_number = 'P1' + case ('pgm') + magic_number = 'P2' + case ('ppm') + magic_number = 'P3' + end select + case ('binary', 'raw') + error stop 'Error: not implementet yet!' + select case (file_format) + case ('pbm') + magic_number = 'P4' + case ('pgm') + magic_number = 'P5' + case ('ppm') + magic_number = 'P6' + end select end select - end subroutine set_pixel + + call this%set_format(encoding) + call this%set_file_format(file_format) + call this%set_header(magic_number, width, height, comment, max_color) + call this%allocate_pixels() + call this%set_pixels(pixels) + end subroutine set_pnm !=============================================================================== + !=============================================================================== !> author: Seyed Ali Ghasemi - impure subroutine export_pnm(this, file_name) + elemental pure subroutine set_width(this, width) class(format_pnm), intent(inout) :: this - character(*), intent(in) :: file_name - integer :: nunit, i - - open (newunit=nunit, file=file_name//'.'//this%file_format, & - status='replace') - write (nunit, '(a)') this%magic_number - write (nunit, '(a,a)') '# ', this%comment - write (nunit, '(g0,1x,g0)') this%width, this%height - if (this%file_format /= 'pbm') write (nunit, '(g0)') this%max_color - do i = 1, size(this%pixels, 1) - write (nunit, '(*(g0,1x))') this%pixels(i, :) - end do - close (nunit) - end subroutine export_pnm + integer, intent(in) :: width + this%width = width + end subroutine set_width !=============================================================================== end module forimage From fd884364b52ce5d13662e97c5364406733c75b76 Mon Sep 17 00:00:00 2001 From: Norwid Behrnd Date: Mon, 7 Aug 2023 12:21:17 +0200 Subject: [PATCH 12/13] correction of a typo, fprettify Correction of a minor typo, passing again fprettify checker. Signed-off-by: Norwid Behrnd --- src/forimage.f90 | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/src/forimage.f90 b/src/forimage.f90 index 653a9f4e..f9bce15a 100644 --- a/src/forimage.f90 +++ b/src/forimage.f90 @@ -53,7 +53,6 @@ elemental pure subroutine allocate_pixels(this) end subroutine allocate_pixels !=============================================================================== - !=============================================================================== !> author: Seyed Ali Ghasemi elemental pure subroutine deallocate_pnm(this) @@ -62,7 +61,6 @@ elemental pure subroutine deallocate_pnm(this) end subroutine deallocate_pnm !=============================================================================== - !=============================================================================== !> author: Seyed Ali Ghasemi impure subroutine export_pnm(this, file_name) @@ -83,7 +81,6 @@ impure subroutine export_pnm(this, file_name) end subroutine export_pnm !=============================================================================== - !=============================================================================== !> author: Seyed Ali Ghasemi impure subroutine import_pnm(this, file_name, file_format, encoding) @@ -100,7 +97,7 @@ impure subroutine import_pnm(this, file_name, file_format, encoding) select case (encoding) case ('binary', 'raw') - print *, 'Error: not implementet yet!' + print *, 'Error: not implemented yet!' select case (file_format) case ('pbm') @@ -153,7 +150,6 @@ impure subroutine import_pnm(this, file_name, file_format, encoding) end subroutine import_pnm !=============================================================================== - !=============================================================================== !> author: Seyed Ali Ghasemi elemental pure subroutine set_comment(this, comment) @@ -163,7 +159,6 @@ elemental pure subroutine set_comment(this, comment) end subroutine set_comment !=============================================================================== - !=============================================================================== !> author: Seyed Ali Ghasemi elemental pure subroutine set_file_format(this, file_format) @@ -174,7 +169,6 @@ elemental pure subroutine set_file_format(this, file_format) end subroutine set_file_format !=============================================================================== - !=============================================================================== !> author: Seyed Ali Ghasemi elemental pure subroutine set_format(this, encoding) @@ -185,7 +179,6 @@ elemental pure subroutine set_format(this, encoding) end subroutine set_format !=============================================================================== - !=============================================================================== !> author: Seyed Ali Ghasemi elemental pure subroutine set_header(this, magic_number, width, height, & @@ -205,7 +198,6 @@ elemental pure subroutine set_header(this, magic_number, width, height, & end subroutine set_header !=============================================================================== - !=============================================================================== !> author: Seyed Ali Ghasemi elemental pure subroutine set_height(this, height) @@ -215,7 +207,6 @@ elemental pure subroutine set_height(this, height) end subroutine set_height !=============================================================================== - !=============================================================================== !> author: Seyed Ali Ghasemi elemental pure subroutine set_magicnumber(this, magic_number) @@ -225,7 +216,6 @@ elemental pure subroutine set_magicnumber(this, magic_number) end subroutine set_magicnumber !=============================================================================== - !=============================================================================== !> author: Seyed Ali Ghasemi elemental pure subroutine set_max_color(this, max_color) @@ -235,7 +225,6 @@ elemental pure subroutine set_max_color(this, max_color) end subroutine set_max_color !=============================================================================== - !=============================================================================== !> author: Seyed Ali Ghasemi pure subroutine set_pixels(this, pixels) @@ -245,7 +234,6 @@ pure subroutine set_pixels(this, pixels) end subroutine set_pixels !=============================================================================== - !=============================================================================== !> author: Seyed Ali Ghasemi pure subroutine set_pnm(this, encoding, file_format, width, height, & @@ -271,7 +259,7 @@ pure subroutine set_pnm(this, encoding, file_format, width, height, & magic_number = 'P3' end select case ('binary', 'raw') - error stop 'Error: not implementet yet!' + error stop 'Error: not implemented yet!' select case (file_format) case ('pbm') magic_number = 'P4' @@ -290,7 +278,6 @@ pure subroutine set_pnm(this, encoding, file_format, width, height, & end subroutine set_pnm !=============================================================================== - !=============================================================================== !> author: Seyed Ali Ghasemi elemental pure subroutine set_width(this, width) From c1f14a988f2fbf6d6e890eda89bc82e86f43c36c Mon Sep 17 00:00:00 2001 From: Norwid Behrnd Date: Mon, 7 Aug 2023 12:26:56 +0200 Subject: [PATCH 13/13] document the use of fprettify style A brief note to use snake_case and the fprettify style for a consistent code format was added. Signed-off-by: Norwid Behrnd --- README.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b65a7eac..d72bdf16 100644 --- a/README.md +++ b/README.md @@ -90,5 +90,8 @@ ford ford.yml ## Contributing -Contributions to `ForImage` are welcome! -If you find any issues or would like to suggest improvements, please open an issue. +Contributions to `ForImage` are welcome! If you find any issues or would like +to suggest improvements, please open an issue. For consistency of the source +code, use `snake_case` to name the variables and procedures and use +[fprettify](https://github.com/pseewald/fprettify) altogether with the style +file `fprettify.rc`.